mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 13:22:55 +08:00
Use scale instead of rotation in ChevronButton
(used in top-right of comments section)
This commit is contained in:
parent
dc630ddc9d
commit
4c2ae07eba
@ -24,6 +24,7 @@ namespace osu.Game.Overlays.Comments.Buttons
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(12),
|
||||
Icon = FontAwesome.Solid.ChevronDown
|
||||
};
|
||||
}
|
||||
|
||||
@ -38,11 +39,12 @@ namespace osu.Game.Overlays.Comments.Buttons
|
||||
base.LoadComplete();
|
||||
Action = Expanded.Toggle;
|
||||
Expanded.BindValueChanged(onExpandedChanged, true);
|
||||
FinishTransforms(true);
|
||||
}
|
||||
|
||||
private void onExpandedChanged(ValueChangedEvent<bool> expanded)
|
||||
{
|
||||
icon.Icon = expanded.NewValue ? FontAwesome.Solid.ChevronUp : FontAwesome.Solid.ChevronDown;
|
||||
icon.ScaleTo(expanded.NewValue ? new Vector2(1f, -1f) : Vector2.One, 300, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user