diff options
| author | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2025-05-20 17:41:00 -0600 |
|---|---|---|
| committer | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2025-05-20 17:41:00 -0600 |
| commit | a364421b093fde425e4d8b11a8629b39ddb68288 (patch) | |
| tree | eb185b6b60b37685cf76bc0d57d1046edf193510 /src/engine/editor/EditorMath.cpp | |
| parent | 2bbc496bf2f9e404244fbd84e9ba88f5eb9af521 (diff) | |
Refactor render_screens and fix editor raycast
Diffstat (limited to 'src/engine/editor/EditorMath.cpp')
| -rw-r--r-- | src/engine/editor/EditorMath.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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(); |
