mirror of
https://github.com/ppy/osu.git
synced 2026-05-19 19:40:46 +08:00
Remove manual handling of autosize now that we are using fixed width display
This commit is contained in:
@@ -119,18 +119,14 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
Size = new Vector2(8f),
|
||||
},
|
||||
Empty(),
|
||||
textContainer = new Container
|
||||
starsText = new OsuSpriteText
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Child = starsText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Margin = new MarginPadding { Bottom = 1.5f },
|
||||
Spacing = new Vector2(-1.4f),
|
||||
Font = OsuFont.Torus.With(size: 14.4f, weight: FontWeight.Bold, fixedWidth: true),
|
||||
Shadow = false,
|
||||
},
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Margin = new MarginPadding { Bottom = 1.5f },
|
||||
Spacing = new Vector2(-1.4f),
|
||||
Font = OsuFont.Torus.With(size: 14.4f, weight: FontWeight.Bold, fixedWidth: true),
|
||||
Shadow = false,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -161,11 +157,6 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
|
||||
starIcon.Colour = s.NewValue >= 6.5 ? colours.Orange1 : colourProvider?.Background5 ?? Color4Extensions.FromHex("303d47");
|
||||
starsText.Colour = s.NewValue >= 6.5 ? colours.Orange1 : colourProvider?.Background5 ?? Color4.Black.Opacity(0.75f);
|
||||
|
||||
// In order to avoid autosize throwing the width of these displays all over the place,
|
||||
// let's lock in some sane defaults for the text width based on how many digits we're
|
||||
// displaying.
|
||||
textContainer.Width = 24 + Math.Max(starsText.Text.ToString().Length - 4, 0) * 6;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user