ソースを参照

Merge pull request #113531 from aaronp64/progress_bar_round

Round `ProgressBar` percentage instead of truncating
Thaddeus Crews 2 週間 前
コミット
db077a4fec
1 ファイル変更1 行追加1 行削除
  1. 1 1
      scene/gui/progress_bar.cpp

+ 1 - 1
scene/gui/progress_bar.cpp

@@ -165,7 +165,7 @@ void ProgressBar::_notification(int p_what) {
 					ratio = CLAMP(percentage, is_lesser_allowed() ? percentage : 0, is_greater_allowed() ? percentage : 1);
 				}
 
-				String txt = itos(int(ratio * 100));
+				String txt = itos(int(Math::round(ratio * 100)));
 
 				if (is_localizing_numeral_system()) {
 					const String &lang = _get_locale();