| 1507 | //----------------------------------------------------------------------------- |
| 1508 | |
| 1509 | bool GuiControl::cursorInControl() |
| 1510 | { |
| 1511 | GuiCanvas *root = getRoot(); |
| 1512 | if (! root) return false; |
| 1513 | |
| 1514 | Point2I pt = root->getCursorPos(); |
| 1515 | pt = root->getPlatformWindow() ? root->getPlatformWindow()->screenToClient(pt) : pt; |
| 1516 | Point2I extent = getExtent(); |
| 1517 | Point2I offset = localToGlobalCoord(Point2I(0, 0)); |
| 1518 | if (pt.x >= offset.x && pt.y >= offset.y && |
| 1519 | pt.x < offset.x + extent.x && pt.y < offset.y + extent.y) |
| 1520 | { |
| 1521 | return true; |
| 1522 | } |
| 1523 | else |
| 1524 | { |
| 1525 | return false; |
| 1526 | } |
| 1527 | } |
| 1528 | |
| 1529 | //----------------------------------------------------------------------------- |
| 1530 |
nothing calls this directly
no test coverage detected