MCPcopy Create free account
hub / github.com/MyGUI/mygui / getCoordNewWidget

Method getCoordNewWidget

Tools/LayoutEditor/WidgetCreatorManager.cpp:191–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189 }
190
191 MyGUI::IntCoord WidgetCreatorManager::getCoordNewWidget(const MyGUI::IntPoint& _point)
192 {
193 MyGUI::IntPoint point = _point;
194
195 MyGUI::Widget* parent = mNewWidget->getParent();
196 if (parent != nullptr && !mNewWidget->isRootWidget())
197 point -= parent->getAbsolutePosition();
198
199 if (!MyGUI::InputManager::getInstance().isShiftPressed())
200 {
201 point.left = GridManager::getInstance().toGrid(point.left);
202 point.top = GridManager::getInstance().toGrid(point.top);
203 }
204
205 MyGUI::IntCoord coord = MyGUI::IntCoord(
206 (std::min)(mStartPoint.left, point.left),
207 (std::min)(mStartPoint.top, point.top),
208 abs(point.left - mStartPoint.left),
209 abs(point.top - mStartPoint.top));
210
211 return coord;
212 }
213
214 void WidgetCreatorManager::setPopupMode(bool _value)
215 {

Callers

nothing calls this directly

Calls 5

isRootWidgetMethod · 0.80
isShiftPressedMethod · 0.80
toGridMethod · 0.80
IntCoordFunction · 0.50
getParentMethod · 0.45

Tested by

no test coverage detected