diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-03 15:26:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 15:26:39 +0200 |
commit | d5d86cb26e65b89a00b644de6eef510d8ca06797 (patch) | |
tree | a474a81d0f6c7148d15453d54cda21c166fd2838 | |
parent | 8aa791d166621014d2b0534e1d448427d4ec260f (diff) | |
parent | f01e1ce1dde0b8d3a5067622a23a2a9da6c2827e (diff) |
Merge pull request #60571 from Sauermann/fix-control-screen-position
Inlcude CanvasLayer transform into calculation of Control screen position
-rw-r--r-- | scene/gui/control.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 35d1cf1f3e..4f2f853be9 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2070,7 +2070,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_viewport()->get_canvas_transform().xform(get_global_position()); + Point2 global_pos = get_global_transform_with_canvas().get_origin(); Window *w = Object::cast_to<Window>(get_viewport()); if (w && !w->is_embedding_subwindows()) { global_pos += w->get_position(); |