| 473 | } |
| 474 | |
| 475 | Point Widget::MapFrom(const Widget* parent, const Point& pos) const |
| 476 | { |
| 477 | Point p = pos; |
| 478 | for (const Widget* cur = this; cur != nullptr; cur = cur->Parent()) |
| 479 | { |
| 480 | if (cur == parent) |
| 481 | return p; |
| 482 | p -= cur->ContentGeometry.topLeft(); |
| 483 | } |
| 484 | throw std::runtime_error("MapFrom: not a parent of widget"); |
| 485 | } |
| 486 | |
| 487 | Point Widget::MapFromGlobal(const Point& pos) const |
| 488 | { |
no test coverage detected