Skip to content

Commit

Permalink
Only calculating the CenterSpline when necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
BlizzCrafter committed Mar 5, 2019
1 parent 344daab commit a9c1822
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions MonoGame.SplineFlower.Samples/Controls/TransformControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ protected override void OnMouseMove(MouseEventArgs e)
SelectedTransform.Translate(new Vector2(-xDiff, -yDiff));
GetSpline.MoveAxis(SelectedTransform.Index, new Vector2(-xDiff, -yDiff));
GetSpline.GetAllTrigger().ForEach(x => x.UpdateTriggerRotation());
GetSpline.CalculateSplineCenter(GetSpline.GetAllPoints());
}
else if (TranslateAllPointsClick) GetSpline.Translate(new Vector2(-xDiff, -yDiff));

GetSpline.CalculateSplineCenter(GetSpline.GetAllPoints());
}
else if (RotatePointClick && !ScalePointClick) GetSpline.Rotate(yDiff);
else if (ScalePointClick && !RotatePointClick) GetSpline.Scale(yDiff);
Expand All @@ -113,8 +112,6 @@ protected void TranslateAllPointsToScreenCenter(Vector2 bezierCenter)
if (_OldBezierDistance != distance) GetSpline.Translate(distance);

_OldBezierDistance = distance;

GetSpline.CalculateSplineCenter(GetSpline.GetAllPoints());
}
}
}

0 comments on commit a9c1822

Please sign in to comment.