| 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 | { |
nothing calls this directly
no test coverage detected