Skip to content

Commit

Permalink
Added ShapeCollection.ForceUpdateDependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Aug 19, 2023
1 parent a57bde6 commit 5ee0bd7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ public void SetValuesOn(ShapeCollection shapeCollection, PositionedObject newSha

for (int i = 0; i < CircleSaves.Count; i++)
{
CircleSave circle = this.CircleSaves[i];
CircleSave circleSave = this.CircleSaves[i];
Circle match = null;

for (int j = 0; j < shapeCollection.Circles.Count; j++)
{
var candidate = shapeCollection.Circles[j];
if (candidate.Name == circle.Name)
if (candidate.Name == circleSave.Name)
{
match = candidate;
break;
Expand All @@ -228,10 +228,10 @@ public void SetValuesOn(ShapeCollection shapeCollection, PositionedObject newSha

if(match != null)
{
circle.SetValuesOn(match);
match.RelativeX = circle.X;
match.RelativeY = circle.Y;
match.RelativeZ = circle.Z;
circleSave.SetValuesOn(match);
match.RelativeX = circleSave.X;
match.RelativeY = circleSave.Y;
match.RelativeZ = circleSave.Z;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,38 @@ public void UpdateDependencies(double currentTime)
}
}

public void ForceUpdateDependencies()
{
for (int i = 0; i < mAxisAlignedRectangles.Count; i++)
{
mAxisAlignedRectangles[i].ForceUpdateDependencies();
}
for (int i = 0; i < mCircles.Count; i++)
{
mCircles[i].ForceUpdateDependencies();
}
for (int i = 0; i < mPolygons.Count; i++)
{
mPolygons[i].ForceUpdateDependencies();
}
for (int i = 0; i < mLines.Count; i++)
{
mLines[i].ForceUpdateDependencies();
}
for (int i = 0; i < mSpheres.Count; i++)
{
mSpheres[i].ForceUpdateDependencies();
}
for (int i = 0; i < mAxisAlignedCubes.Count; i++)
{
mAxisAlignedCubes[i].ForceUpdateDependencies();
}
for (int i = 0; i < mCapsule2Ds.Count; i++)
{
mCapsule2Ds[i].ForceUpdateDependencies();
}
}

public void FlipHorizontally()
{
#region Flip the AxisAlignedRectangles
Expand Down

0 comments on commit 5ee0bd7

Please sign in to comment.