Remove transform overhead from OsuDropdown on initial display

This commit is contained in:
Dean Herbert
2021-08-16 18:56:02 +09:00
parent c0130da235
commit 92ad66c86c

View File

@ -69,6 +69,7 @@ namespace osu.Game.Graphics.UserInterface
BackgroundColour = Color4.Black.Opacity(0.5f); BackgroundColour = Color4.Black.Opacity(0.5f);
MaskingContainer.CornerRadius = corner_radius; MaskingContainer.CornerRadius = corner_radius;
Alpha = 0;
// todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring // todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring
ItemsContainer.Padding = new MarginPadding(5); ItemsContainer.Padding = new MarginPadding(5);
@ -94,10 +95,12 @@ namespace osu.Game.Graphics.UserInterface
protected override void AnimateClose() protected override void AnimateClose()
{ {
this.FadeOut(300, Easing.OutQuint);
if (wasOpened) if (wasOpened)
{
this.FadeOut(300, Easing.OutQuint);
sampleClose?.Play(); sampleClose?.Play();
} }
}
// todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring // todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring
protected override void UpdateSize(Vector2 newSize) protected override void UpdateSize(Vector2 newSize)