1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Use RangePadding to align mouse with slider

This commit is contained in:
Gyoshi 2023-05-23 17:59:07 +02:00
parent fa00f8b92a
commit b5f8093941
2 changed files with 4 additions and 3 deletions

View File

@ -90,10 +90,10 @@ namespace osu.Game.Tests.Visual.Editing
private Vector2 getPositionForDivisor(int divisor)
{
float localX = 1 - 1 / (float)divisor;
float localX = (1 - 1 / (float)divisor) * tickSliderBar.UsableWidth + tickSliderBar.RangePadding;
return tickSliderBar.ToScreenSpace(new Vector2(
localX,
0.5f
tickSliderBar.DrawHeight / 2
));
}

View File

@ -383,7 +383,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
CurrentNumber.BindTo(this.beatDivisor = beatDivisor);
Padding = new MarginPadding { Horizontal = 5 };
RangePadding = 5;
Padding = new MarginPadding { Horizontal = RangePadding };
}
protected override void LoadComplete()