diff options
Diffstat (limited to 'scene/gui/progress_bar.cpp')
-rw-r--r-- | scene/gui/progress_bar.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index c66b30f130..b2617e6fc7 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -35,15 +35,13 @@ Size2 ProgressBar::get_minimum_size() const { Size2 minimum_size = theme_cache.background_style->get_minimum_size(); - minimum_size.height = MAX(minimum_size.height, theme_cache.fill_style->get_minimum_size().height); - minimum_size.width = MAX(minimum_size.width, theme_cache.fill_style->get_minimum_size().width); + minimum_size = minimum_size.max(theme_cache.fill_style->get_minimum_size()); if (show_percentage) { String txt = "100%"; TextLine tl = TextLine(txt, theme_cache.font, theme_cache.font_size); minimum_size.height = MAX(minimum_size.height, theme_cache.background_style->get_minimum_size().height + tl.get_size().y); } else { // this is needed, else the progressbar will collapse - minimum_size.width = MAX(minimum_size.width, 1); - minimum_size.height = MAX(minimum_size.height, 1); + minimum_size = minimum_size.max(Size2(1, 1)); } return minimum_size; } |