mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Improve UX of selecting PerfectCurve
This commit is contained in:
parent
725edfcbf3
commit
0341023d13
@ -162,6 +162,22 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
/// <param name="type">The path type we want to assign to the given control point piece.</param>
|
/// <param name="type">The path type we want to assign to the given control point piece.</param>
|
||||||
private void updatePathType(PathControlPointPiece piece, PathType? type)
|
private void updatePathType(PathControlPointPiece piece, PathType? type)
|
||||||
{
|
{
|
||||||
|
int indexInSegment = piece.PointsInSegment.IndexOf(piece.ControlPoint);
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case PathType.PerfectCurve:
|
||||||
|
if (piece.PointsInSegment.Count > 3)
|
||||||
|
{
|
||||||
|
// Can't always create a circular arc out of 4 or more points,
|
||||||
|
// so we split the segment into one 3-point circular arc segment
|
||||||
|
// and one bezier segment.
|
||||||
|
piece.PointsInSegment[indexInSegment + 2].Type.Value = PathType.Bezier;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
piece.ControlPoint.Type.Value = type;
|
piece.ControlPoint.Type.Value = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user