From 91eb80041d588ef22926422ae2fc39f375e11aec Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Wed, 28 Mar 2018 20:52:55 +0300 Subject: Fix StyleBox ignoring region rect and ProgressBar using center size ProgressBar used the center size of the stylebox to calculate its minimum size, thus disallowing certain setups. If the old behaviour is wanted, it can be forced by providing a custom minimum size, or by giving proper margins to the stylebox. Fixes #17779. --- scene/resources/style_box.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/resources/style_box.cpp') diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 626fda50d..e87fd7baf 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -182,7 +182,7 @@ Size2 StyleBoxTexture::get_center_size() const { if (texture.is_null()) return Size2(); - return texture->get_size() - get_minimum_size(); + return region_rect.size - get_minimum_size(); } void StyleBoxTexture::set_expand_margin_size(Margin p_expand_margin, float p_size) { -- cgit v1.2.3-70-g09d2