| 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 | } |
no test coverage detected