瀏覽代碼

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.
Ferenc Arn 8 年之前
父節點
當前提交
d9d9571c8c
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      editor/plugins/spatial_editor_plugin.cpp

+ 5 - 1
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)