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

Method MapFromGlobal

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

Source from the content-addressed store, hash-verified

485}
486
487Point Widget::MapFromGlobal(const Point& pos) const
488{
489 Point p = pos;
490 for (const Widget* cur = this; cur != nullptr; cur = cur->Parent())
491 {
492 if (cur->DispWindow)
493 {
494 return p - cur->GetFrameGeometry().topLeft();
495 }
496 p -= cur->ContentGeometry.topLeft();
497 }
498 throw std::runtime_error("MapFromGlobal: no window widget found");
499}
500
501Point Widget::MapTo(const Widget* parent, const Point& pos) const
502{

Callers

nothing calls this directly

Calls 3

ParentMethod · 0.80
topLeftMethod · 0.80
GetFrameGeometryMethod · 0.80

Tested by

no test coverage detected