From ff51d69ede2e6e9393e3a9d349ea645ae65c5bb7 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 4 Feb 2023 00:30:56 +0100 Subject: Fixed scaling order when transforming screen to world --- engine/src/Camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/src') diff --git a/engine/src/Camera.cpp b/engine/src/Camera.cpp index 60e8aa1..41cc5ab 100644 --- a/engine/src/Camera.cpp +++ b/engine/src/Camera.cpp @@ -17,7 +17,7 @@ static auto viewport() -> Point; Point Camera::to_world(const Point& screen) const { - return screen - viewport().scale(1.0 / (2.0 * scale)) + offset; + return (screen - viewport().scale(0.5)).scale(1.0 / scale) + offset; } -- cgit v1.1