Browse Source

Fixed moving ellipses

flabbet 11 months ago
parent
commit
dc1df7a409

+ 10 - 3
src/PixiEditor.ChangeableDocument/Changes/Drawing/TransformSelected_UpdateableChange.cs

@@ -114,7 +114,7 @@ internal class TransformSelected_UpdateableChange : UpdateableChange
             }
             else if (layer is ITransformableObject transformable)
             {
-                SetTransformableMember(layer, member, transformable);
+                SetTransformableMember(layer, member, transformable, tightBounds);
             }
         }
 
@@ -122,9 +122,9 @@ internal class TransformSelected_UpdateableChange : UpdateableChange
     }
 
     private void SetTransformableMember(StructureNode layer, MemberTransformationData member,
-        ITransformableObject transformable)
+        ITransformableObject transformable, RectD tightBounds)
     {
-        member.OriginalBounds = layer.GetTightBounds(frame).Value;
+        member.OriginalBounds = tightBounds; 
         VecD posRelativeToMaster = member.OriginalBounds.Value.TopLeft - masterCorners.TopLeft;
 
         member.OriginalPos = (VecI)posRelativeToMaster;
@@ -190,6 +190,13 @@ internal class TransformSelected_UpdateableChange : UpdateableChange
                             (float)member.OriginalPos.Value.Y - (float)member.OriginalBounds.Value.Top))
                         .PostConcat(tightBoundsGlobalMatrix);
                 }
+                else
+                {
+                    localMatrix = Matrix3X3.CreateTranslation(
+                        (float)-member.OriginalBounds.Value.X,
+                        (float)-member.OriginalBounds.Value.Y);
+                    localMatrix = localMatrix.PostConcat(tightBoundsGlobalMatrix);
+                }
             }
 
             member.LocalMatrix = localMatrix;