summaryrefslogtreecommitdiff
path: root/editor/plugins/spatial_editor_plugin.cpp
diff options
context:
space:
mode:
authorFerenc Arn <tagcup@yahoo.com>2017-08-22 20:05:41 -0400
committerFerenc Arn <tagcup@yahoo.com>2017-08-22 20:05:41 -0400
commitd9d9571c8ca1f0be9c1bfe58cddde3d249e627df (patch)
tree3eede3c1d428df1dc32d4e195448cfb38d029736 /editor/plugins/spatial_editor_plugin.cpp
parenteb238a04dacae397db393cbce74891cf90405a67 (diff)
Fix the order of transformations for selection bounding box in spatial editor.
This was broken in #7438 where the ordering of scaling in Basis::scale() was fixed, but this line of code (which relied on the incorrect behavior) wasn't updated correctly. Fixes #9894.
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.cpp')
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index bca1f254b0..1d25f9e56b 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -1756,7 +1756,11 @@ void SpatialEditorViewport::_notification(int p_what) {
Transform t = sp->get_global_transform();
t.translate(se->aabb.position);
- t.basis.scale(se->aabb.size);
+
+ // apply AABB scaling before item's global transform
+ Basis aabb_s;
+ aabb_s.scale(se->aabb.size);
+ t.basis = t.basis * aabb_s;
exist = true;
if (se->last_xform == t)