summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-03 14:29:20 +0200
committerGitHub <noreply@github.com>2021-07-03 14:29:20 +0200
commita525e7774006a7439779c7b1bd64ed0f2ccf6385 (patch)
tree3eb1efb3007e927677146a223c4c35f743e04cf6 /scene/gui
parentecf9ea740ef99afbfac94fc5da50988279fd9b9b (diff)
parentae324444ba4917fd6146fe2f91d10a484e37d690 (diff)
Merge pull request #49468 from menip/FixGetScreenPosition
Fix Control::get_screen_position() not considering viewport scale
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/control.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 4063d404d1..d42b505f7b 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1488,7 +1488,7 @@ Point2 Control::get_global_position() const {
Point2 Control::get_screen_position() const {
ERR_FAIL_COND_V(!is_inside_tree(), Point2());
- Point2 global_pos = get_global_position();
+ Point2 global_pos = get_viewport()->get_canvas_transform().xform(get_global_position());
Window *w = Object::cast_to<Window>(get_viewport());
if (w && !w->is_embedding_subwindows()) {
global_pos += w->get_position();