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

Method setPosition

Tools/LayoutEditor/EditorToolTip.cpp:158–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 }
157
158 void EditorToolTip::setPosition(const MyGUI::IntPoint& _point)
159 {
160 const MyGUI::IntPoint offset(10, 10);
161
162 MyGUI::IntPoint point = _point + offset;
163
164 const MyGUI::IntSize& size = mMainWidget->getSize();
165 const MyGUI::IntSize& view_size = mMainWidget->getParentSize();
166
167 if ((point.left + size.width) > view_size.width)
168 {
169 point.left -= offset.left + offset.left + size.width;
170 }
171 if ((point.top + size.height) > view_size.height)
172 {
173 point.top -= offset.top + offset.top + size.height;
174 }
175
176 mMainWidget->setPosition(point);
177 }
178
179}

Callers 1

onDoModalMethod · 0.45

Calls 2

getParentSizeMethod · 0.80
getSizeMethod · 0.45

Tested by

no test coverage detected