MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ViewportFindFromPoint

Function ViewportFindFromPoint

src/openrct2/interface/Viewport.cpp:1782–1797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1780 }
1781
1782 Viewport* ViewportFindFromPoint(const ScreenCoordsXY& screenCoords)
1783 {
1784 auto* windowMgr = Ui::GetWindowManager();
1785 WindowBase* w = windowMgr->FindFromPoint(screenCoords);
1786 if (w == nullptr)
1787 return nullptr;
1788
1789 Viewport* viewport = w->viewport;
1790 if (viewport == nullptr)
1791 return nullptr;
1792
1793 if (viewport->ContainsScreen(screenCoords))
1794 return viewport;
1795
1796 return nullptr;
1797 }
1798
1799 /**
1800 *

Callers 2

ScreenGetMapXYWithZFunction · 0.85
handleViewScrollingMethod · 0.85

Calls 3

GetWindowManagerFunction · 0.85
ContainsScreenMethod · 0.80
FindFromPointMethod · 0.45

Tested by

no test coverage detected