|
@@ -119,21 +119,22 @@ internal class TransformSelected_UpdateableChange : InterruptableUpdateableChang
|
|
|
}
|
|
|
else if (layer is ITransformableObject transformable)
|
|
|
{
|
|
|
- SetTransformableMember(layer, member, transformable, tightBounds);
|
|
|
+ SetTransformableMember(layer.Id, member, transformable, tightBounds);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private void SetTransformableMember(StructureNode layer, MemberTransformationData member,
|
|
|
+ private void SetTransformableMember(Guid transformableId,
|
|
|
+ MemberTransformationData member,
|
|
|
ITransformableObject transformable, RectD tightBounds)
|
|
|
{
|
|
|
member.OriginalBounds = tightBounds;
|
|
|
VecD posRelativeToMaster = member.OriginalBounds.Value.TopLeft - masterCorners.TopLeft;
|
|
|
|
|
|
member.OriginalPos = (VecI)posRelativeToMaster;
|
|
|
- member.AddTransformableObject(transformable, transformable.TransformationMatrix);
|
|
|
+ member.AddTransformableObject(transformableId, transformable.TransformationMatrix);
|
|
|
}
|
|
|
|
|
|
private void SetImageMember(Document target, MemberTransformationData member, RectD originalTightBounds,
|
|
@@ -256,7 +257,8 @@ internal class TransformSelected_UpdateableChange : InterruptableUpdateableChang
|
|
|
}
|
|
|
else if (member.IsTransformable)
|
|
|
{
|
|
|
- member.TransformableObject.TransformationMatrix = member.LocalMatrix;
|
|
|
+ var transformable = target.FindMemberOrThrow(member.MemberId) as ITransformableObject;
|
|
|
+ transformable.TransformationMatrix = member.LocalMatrix;
|
|
|
|
|
|
AffectedArea area = GetTranslationAffectedArea();
|
|
|
infos.Add(new TransformObject_ChangeInfo(member.MemberId, area));
|
|
@@ -291,7 +293,8 @@ internal class TransformSelected_UpdateableChange : InterruptableUpdateableChang
|
|
|
}
|
|
|
else if (member.IsTransformable)
|
|
|
{
|
|
|
- member.TransformableObject.TransformationMatrix = member.LocalMatrix;
|
|
|
+ var transformable = target.FindMemberOrThrow(member.MemberId) as ITransformableObject;
|
|
|
+ transformable.TransformationMatrix = member.LocalMatrix;
|
|
|
|
|
|
AffectedArea translationAffectedArea = GetTranslationAffectedArea();
|
|
|
var tmp = new AffectedArea(translationAffectedArea);
|
|
@@ -332,7 +335,8 @@ internal class TransformSelected_UpdateableChange : InterruptableUpdateableChang
|
|
|
}
|
|
|
else if (member.IsTransformable)
|
|
|
{
|
|
|
- member.TransformableObject.TransformationMatrix = member.OriginalMatrix!.Value;
|
|
|
+ var transformable = target.FindMemberOrThrow(member.MemberId) as ITransformableObject;
|
|
|
+ transformable.TransformationMatrix = member.OriginalMatrix!.Value;
|
|
|
|
|
|
//TODO this is probably wrong
|
|
|
AffectedArea area = GetTranslationAffectedArea();
|
|
@@ -410,7 +414,7 @@ class MemberTransformationData : IDisposable
|
|
|
public Guid MemberId { get; }
|
|
|
public ShapeCorners MemberCorners { get; init; }
|
|
|
|
|
|
- public ITransformableObject? TransformableObject { get; private set; }
|
|
|
+ public Guid TransformableObjectId { get; private set; }
|
|
|
public Matrix3X3? OriginalMatrix { get; set; }
|
|
|
|
|
|
public CommittedChunkStorage? SavedChunks { get; set; }
|
|
@@ -419,7 +423,7 @@ class MemberTransformationData : IDisposable
|
|
|
public RectD? OriginalBounds { get; set; }
|
|
|
public VecD? OriginalPos { get; set; }
|
|
|
public bool IsImage => Image != null;
|
|
|
- public bool IsTransformable => TransformableObject != null;
|
|
|
+ public bool IsTransformable => TransformableObjectId != default;
|
|
|
public RectI? RoundedOriginalBounds => (RectI)OriginalBounds?.RoundOutwards();
|
|
|
public Matrix3X3 LocalMatrix { get; set; }
|
|
|
public ShapeVectorData? OriginalShapeData { get; set; }
|
|
@@ -429,9 +433,9 @@ class MemberTransformationData : IDisposable
|
|
|
MemberId = memberId;
|
|
|
}
|
|
|
|
|
|
- public void AddTransformableObject(ITransformableObject transformableObject, Matrix3X3 originalMatrix)
|
|
|
+ public void AddTransformableObject(Guid transformableObject, Matrix3X3 originalMatrix)
|
|
|
{
|
|
|
- TransformableObject = transformableObject;
|
|
|
+ TransformableObjectId = transformableObject;
|
|
|
OriginalMatrix = new Matrix3X3?(originalMatrix);
|
|
|
}
|
|
|
|