From 56b5af2ba78fdcd8b7555d4c79ac1ef1ab9d2ac8 Mon Sep 17 00:00:00 2001 From: Emmanuel Barroga Date: Tue, 30 Jul 2019 21:47:11 -0700 Subject: [PATCH] Fix ProgressBar Wrong Value with Border Closes: #30969 The FG rectangle of the progressbar is incorrect when dealing with a non-zero border. This issue stems from wrong order of operations when drawing the rectangle: int p = r * get_size().width - mp; (cherry picked from commit 7db96e22dd2b6f52df2474e750d9b8445d23c137) --- scene/gui/progress_bar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index ec2a83d525c..d41c0933c87 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -54,7 +54,7 @@ void ProgressBar::_notification(int p_what) { draw_style_box(bg, Rect2(Point2(), get_size())); float r = get_as_ratio(); int mp = fg->get_minimum_size().width; - int p = r * get_size().width - mp; + int p = r * (get_size().width - mp); if (p > 0) { draw_style_box(fg, Rect2(Point2(), Size2(p + fg->get_minimum_size().width, get_size().height)));