From 0bba09c4cb98525ccc88aa69574162458a79abb6 Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Thu, 31 Mar 2016 12:58:07 +0100 Subject: [PATCH] Progress bar minsize now checks percent_visible Allows for really thin progress bars such as for pixel-art styles. --- scene/gui/progress_bar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index fc0e7be34f8..02da8ff27e5 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -35,7 +35,9 @@ Size2 ProgressBar::get_minimum_size() const { Ref font = get_font("font"); Size2 ms=bg->get_minimum_size()+bg->get_center_size(); - ms.height=MAX(ms.height,bg->get_minimum_size().height+font->get_height()); + if (percent_visible) { + ms.height=MAX(ms.height,bg->get_minimum_size().height+font->get_height()); + } return ms; }