From 25ddd20b2e2195ae209baa52d83b7a209377a134 Mon Sep 17 00:00:00 2001 From: ansel <79257300125@ya.ru> Date: Tue, 29 Nov 2022 05:44:40 +0300 Subject: [PATCH] Allow OsuButton be auto-sized --- osu.Game/Graphics/UserInterface/OsuButton.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index fa61b06cff..69e8dfef84 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -175,6 +175,17 @@ namespace osu.Game.Graphics.UserInterface base.OnMouseUp(e); } + public new Axes AutoSizeAxes + { + get => base.AutoSizeAxes; + set + { + base.AutoSizeAxes = value; + Content.RelativeSizeAxes = ~value; + Content.AutoSizeAxes = value; + } + } + protected virtual SpriteText CreateText() => new OsuSpriteText { Depth = -1,