summaryrefslogtreecommitdiff
path: root/scene/gui/progress_bar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/progress_bar.cpp')
-rw-r--r--scene/gui/progress_bar.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp
index 505068f155..37e519e375 100644
--- a/scene/gui/progress_bar.cpp
+++ b/scene/gui/progress_bar.cpp
@@ -27,18 +27,22 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "progress_bar.h"
Size2 ProgressBar::get_minimum_size() const {
Ref<StyleBox> bg = get_stylebox("bg");
+ Ref<StyleBox> fg = get_stylebox("fg");
Ref<Font> font = get_font("font");
- Size2 ms = bg->get_minimum_size() + bg->get_center_size();
+ Size2 minimum_size = bg->get_minimum_size();
+ minimum_size.height = MAX(minimum_size.height, fg->get_minimum_size().height);
+ minimum_size.width = MAX(minimum_size.width, fg->get_minimum_size().width);
if (percent_visible) {
- ms.height = MAX(ms.height, bg->get_minimum_size().height + font->get_height());
+ minimum_size.height = MAX(minimum_size.height, bg->get_minimum_size().height + font->get_height());
}
- return ms;
+ return minimum_size;
}
void ProgressBar::_notification(int p_what) {