You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #60571 from Sauermann/fix-control-screen-position
Inlcude CanvasLayer transform into calculation of Control screen position
This commit is contained in:
@@ -2070,7 +2070,7 @@ Point2 Control::get_global_position() const {
|
|||||||
|
|
||||||
Point2 Control::get_screen_position() const {
|
Point2 Control::get_screen_position() const {
|
||||||
ERR_FAIL_COND_V(!is_inside_tree(), Point2());
|
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());
|
Window *w = Object::cast_to<Window>(get_viewport());
|
||||||
if (w && !w->is_embedding_subwindows()) {
|
if (w && !w->is_embedding_subwindows()) {
|
||||||
global_pos += w->get_position();
|
global_pos += w->get_position();
|
||||||
|
|||||||
Reference in New Issue
Block a user