diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 9a3070b5c5a..32380b64577 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -74,7 +74,7 @@ void Popup::_fix_size() { Point2 pos = get_global_position(); Size2 size = get_size() * get_scale(); - Point2 window_size = get_viewport_rect().size; + Point2 window_size = get_viewport_rect().size - get_viewport_transform().get_origin(); if (pos.x + size.width > window_size.width) pos.x = window_size.width - size.width;