mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:57:52 +08:00
Fix reference points being wrongly selected
This commit is contained in:
parent
efae00c149
commit
cee8bb50c9
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
Blending = BlendingMode.Additive;
|
Blending = BlendingMode.Additive;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SpriteIcon
|
new SpriteIcon
|
||||||
@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
var curve = drawableSlider.CurrentCurve;
|
var curve = drawableSlider.CurrentCurve;
|
||||||
if (curve.Count < 3 || curve.All(p => p == Position))
|
if (curve.Count < 3 || curve.All(p => p == Position))
|
||||||
return;
|
return;
|
||||||
var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position) - 1 : curve.LastIndexOf(Position) + 1];
|
var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position, curve.Count - 2) - 1 : curve[0] == curve[1] ? 2 : 1];
|
||||||
Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X));
|
Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user