From a364421b093fde425e4d8b11a8629b39ddb68288 Mon Sep 17 00:00:00 2001 From: MegaMech <7255464+MegaMech@users.noreply.github.com> Date: Tue, 20 May 2025 17:41:00 -0600 Subject: Refactor render_screens and fix editor raycast --- src/engine/editor/EditorMath.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/engine/editor/EditorMath.cpp') diff --git a/src/engine/editor/EditorMath.cpp b/src/engine/editor/EditorMath.cpp index 44923e08e..04a299563 100644 --- a/src/engine/editor/EditorMath.cpp +++ b/src/engine/editor/EditorMath.cpp @@ -31,9 +31,9 @@ bool IsInGameScreen() { // Define viewport boundaries auto gfx_current_game_window_viewport = GetInterpreter()->mGameWindowViewport; - int left = gfx_current_game_window_viewport.width; + int left = gfx_current_game_window_viewport.x; int right = left + OTRGetGameRenderWidth(); - int top = gfx_current_game_window_viewport.height; + int top = gfx_current_game_window_viewport.y; int bottom = top + OTRGetGameRenderHeight(); // Check if the mouse is within the game render area @@ -46,8 +46,8 @@ FVector ScreenRayTrace() { Ship::Coords mouse = wnd->GetMousePos(); auto gfx_current_game_window_viewport = GetInterpreter()->mGameWindowViewport; - mouse.x -= gfx_current_game_window_viewport.width; - mouse.y -= gfx_current_game_window_viewport.height; + mouse.x -= gfx_current_game_window_viewport.x; + mouse.y -= gfx_current_game_window_viewport.y; // Get screen dimensions uint32_t width = OTRGetGameViewportWidth(); uint32_t height = OTRGetGameViewportHeight(); -- cgit v1.2.3