diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-12 13:41:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12 13:41:42 +0100 |
commit | dfe4990b18d0ab34fda09d5dcaa2b4f6492ed2b7 (patch) | |
tree | 0c1bbe847a4a1c986ffec5b909940472458e4007 /scene | |
parent | cb09abdbbdb01fdeb8462853ad7324a6d0af0c81 (diff) | |
parent | 163cdb89547fcc110a8693216be09668eea97223 (diff) |
Merge pull request #25496 from ptrojahn/lookat
Fix look_at with non uniform scaling
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/node_2d.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 9a94092840..f4430d93f6 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -376,7 +376,7 @@ void Node2D::look_at(const Vector2 &p_pos) { float Node2D::get_angle_to(const Vector2 &p_pos) const { - return (get_global_transform().affine_inverse().xform(p_pos)).angle(); + return (to_local(p_pos) * get_scale()).angle(); } Point2 Node2D::to_local(Point2 p_global) const { |