MCPcopy Create free account
hub / github.com/ZDoom/Raze / MapFrom

Method MapFrom

libraries/ZWidget/src/core/widget.cpp:475–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475Point 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
487Point Widget::MapFromGlobal(const Point& pos) const
488{

Callers 5

OnWindowMouseMoveMethod · 0.80
OnWindowMouseDownMethod · 0.80
OnWindowMouseUpMethod · 0.80
OnWindowMouseWheelMethod · 0.80

Calls 2

ParentMethod · 0.80
topLeftMethod · 0.80

Tested by

no test coverage detected