mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Fix IconButtons not being scaled correctly
This commit is contained in:
@ -11,7 +11,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class IconButton : OsuAnimatedButton
|
||||
{
|
||||
public const float BUTTON_SIZE = 30;
|
||||
public const float DEFAULT_BUTTON_SIZE = 30;
|
||||
|
||||
private Color4? iconColour;
|
||||
|
||||
@ -57,26 +57,11 @@ namespace osu.Game.Graphics.UserInterface
|
||||
set => icon.Scale = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The size of the <see cref="IconButton"/> while it is not being pressed.
|
||||
/// </summary>
|
||||
public Vector2 ButtonSize
|
||||
{
|
||||
get => Content.Size;
|
||||
set
|
||||
{
|
||||
Content.RelativeSizeAxes = Axes.None;
|
||||
Content.AutoSizeAxes = Axes.None;
|
||||
Content.Size = value;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly SpriteIcon icon;
|
||||
|
||||
public IconButton()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
ButtonSize = new Vector2(BUTTON_SIZE);
|
||||
Size = new Vector2(DEFAULT_BUTTON_SIZE);
|
||||
|
||||
Add(icon = new SpriteIcon
|
||||
{
|
||||
|
Reference in New Issue
Block a user