From b83359518fbc5e36e7eca37a5ae83e7d2c1b632b Mon Sep 17 00:00:00 2001 From: Mark DiBarry Date: Sun, 7 Jul 2024 10:44:13 -0400 Subject: [PATCH] Remove unused assignment in Parallax2D --- scene/2d/parallax_2d.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scene/2d/parallax_2d.cpp b/scene/2d/parallax_2d.cpp index aacab3213d9..b3586a1da0a 100644 --- a/scene/2d/parallax_2d.cpp +++ b/scene/2d/parallax_2d.cpp @@ -86,11 +86,10 @@ void Parallax2D::_update_scroll() { } Point2 scroll_ofs = screen_offset; - Size2 vps = get_viewport_rect().size; - if (Engine::get_singleton()->is_editor_hint()) { - vps = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height")); - } else { + if (!Engine::get_singleton()->is_editor_hint()) { + Size2 vps = get_viewport_rect().size; + if (limit_begin.x <= limit_end.x - vps.x) { scroll_ofs.x = CLAMP(scroll_ofs.x, limit_begin.x, limit_end.x - vps.x); }