Fix sliderbar not working correctly with TransferValueOnCommit = true

This commit is contained in:
smoogipoo
2019-01-08 16:07:54 +09:00
parent 7bb4a06122
commit 8692be9de3
4 changed files with 45 additions and 52 deletions

View File

@ -238,11 +238,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
case Key.Right:
beatDivisor.Next();
OnUserChange();
OnUserChange(Current);
return true;
case Key.Left:
beatDivisor.Previous();
OnUserChange();
OnUserChange(Current);
return true;
default:
return false;
@ -279,7 +279,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
var xPosition = (ToLocalSpace(screenSpaceMousePosition).X - RangePadding) / UsableWidth;
CurrentNumber.Value = availableDivisors.OrderBy(d => Math.Abs(getMappedPosition(d) - xPosition)).First();
OnUserChange();
OnUserChange(Current);
}
private float getMappedPosition(float divisor) => (float)Math.Pow((divisor - 1) / (availableDivisors.Last() - 1), 0.90f);