diff options
author | Zher Huei Lee <lee.zh.92@gmail.com> | 2016-03-31 12:58:07 +0100 |
---|---|---|
committer | Zher Huei Lee <lee.zh.92@gmail.com> | 2016-03-31 12:58:07 +0100 |
commit | 0bba09c4cb98525ccc88aa69574162458a79abb6 (patch) | |
tree | a015957c3b5c9daa6d58ce46d0c2e055652862ed | |
parent | 8708a284f7b5390a48ea2fd95848f60cc40d0bf0 (diff) |
Progress bar minsize now checks percent_visible
Allows for really thin progress bars such as for pixel-art styles.
-rw-r--r-- | scene/gui/progress_bar.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index fc0e7be34f..02da8ff27e 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> 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; } |