浏览代码

Progress bar minsize now checks percent_visible

Allows for really thin progress bars such as for pixel-art styles.
Zher Huei Lee 9 年之前
父节点
当前提交
0bba09c4cb
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      scene/gui/progress_bar.cpp

+ 3 - 1
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;
 }