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

Method ScreenToViewportCoord

src/openrct2/interface/Viewport.cpp:1076–1082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1074 }
1075
1076 [[nodiscard]] ScreenCoordsXY Viewport::ScreenToViewportCoord(const ScreenCoordsXY& screenCoords) const
1077 {
1078 ScreenCoordsXY ret;
1079 ret.x = (zoom.ApplyTo(screenCoords.x - pos.x)) + viewPos.x;
1080 ret.y = (zoom.ApplyTo(screenCoords.y - pos.y)) + viewPos.y;
1081 return ret;
1082 }
1083
1084 void Viewport::Invalidate() const
1085 {

Calls 1

ApplyToMethod · 0.80

Tested by

no test coverage detected