diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-06-21 21:41:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-21 21:41:10 +0200 |
commit | e69e50040b51d3cba4bb38b848bac6ed003640d7 (patch) | |
tree | 2acdcd7d11c8958a06d95f45adbd44942ec42a38 /scene | |
parent | a3e69b7bab5fe15eacdbfabf5f89a8f43a7c0be6 (diff) | |
parent | f3342eb72e8d2768d2457abbec28ccedc865876a (diff) |
Merge pull request #5349 from bojidar-bg/fix-camera2d-screen-preview
Fix a inherited transform bug with Camera2D preview drawing
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/camera_2d.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index fd8a0ed0f3..85256be940 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -281,11 +281,10 @@ void Camera2D::_notification(int p_what) { inv_camera_transform.xform(Vector2(0, screen_size.height)) }; - Matrix32 inv_transform = get_transform().affine_inverse(); // undo global space - draw_set_transform(inv_transform.get_origin(), inv_transform.get_rotation(), inv_transform.get_scale()); + Matrix32 inv_transform = get_global_transform().affine_inverse(); // undo global space for(int i=0;i<4;i++) { - draw_line(screen_endpoints[i], screen_endpoints[(i+1)%4], area_axis_color, area_axis_width); + draw_line(inv_transform.xform(screen_endpoints[i]), inv_transform.xform(screen_endpoints[(i+1)%4]), area_axis_color, area_axis_width); } } break; |