mirror of https://github.com/ppy/osu
Merge pull request #12220 from peppy/editor-fix-speed-multiplier-precision
Fix legacy control point precision having an adverse effect on the editor
This commit is contained in:
commit
f6f1ef6986
|
@ -28,7 +28,16 @@ protected override void OnControlPointChanged(ValueChangedEvent<DifficultyContro
|
||||||
{
|
{
|
||||||
if (point.NewValue != null)
|
if (point.NewValue != null)
|
||||||
{
|
{
|
||||||
multiplierSlider.Current = point.NewValue.SpeedMultiplierBindable;
|
var selectedPointBindable = point.NewValue.SpeedMultiplierBindable;
|
||||||
|
|
||||||
|
// there may be legacy control points, which contain infinite precision for compatibility reasons (see LegacyDifficultyControlPoint).
|
||||||
|
// generally that level of precision could only be set by externally editing the .osu file, so at the point
|
||||||
|
// a user is looking to update this within the editor it should be safe to obliterate this additional precision.
|
||||||
|
double expectedPrecision = new DifficultyControlPoint().SpeedMultiplierBindable.Precision;
|
||||||
|
if (selectedPointBindable.Precision < expectedPrecision)
|
||||||
|
selectedPointBindable.Precision = expectedPrecision;
|
||||||
|
|
||||||
|
multiplierSlider.Current = selectedPointBindable;
|
||||||
multiplierSlider.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
|
multiplierSlider.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue