summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-02-01 16:49:35 +0100
committerGitHub <noreply@github.com>2018-02-01 16:49:35 +0100
commit51d3dee9c265fb9cb2617543c64e79e3a9e8e69f (patch)
tree4cdf3f6a82ced7debda7f83ecff8f5aedad8d248
parent2459eebc1d0d679efb546aa5a95ddd493290a7aa (diff)
parent517ff5c8d71884a09114191ac79bf8c990f391ca (diff)
Merge pull request #15946 from MarianoGnu/issue_15870
Attemp to fix #15870
-rw-r--r--scene/resources/style_box.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index 6811517ead..de75bb3976 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -651,8 +651,8 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const {
}
//adapt borders (prevent weired overlapping/glitchy drawings)
- int width = style_rect.size.width;
- int height = style_rect.size.height;
+ int width = MAX(style_rect.size.width, 0);
+ int height = MAX(style_rect.size.height, 0);
int adapted_border[4] = { INT_MAX, INT_MAX, INT_MAX, INT_MAX };
adapt_values(MARGIN_TOP, MARGIN_BOTTOM, adapted_border, border_width, height, height, height);
adapt_values(MARGIN_LEFT, MARGIN_RIGHT, adapted_border, border_width, width, width, width);