diff options
| author | Mariano Suligoy | 2018-01-21 12:31:59 -0300 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-02-04 19:59:34 +0100 |
| commit | 77cc0a023b82dccacee27f67e8df14df91c1f3b7 (patch) | |
| tree | 48d40b8d19fb76869a9312be24c720b6f1216886 /scene/resources/style_box.cpp | |
| parent | 1036a76bc5c98e63931f6791502021104d5fd010 (diff) | |
| download | godot-77cc0a023b82dccacee27f67e8df14df91c1f3b7.tar.gz godot-77cc0a023b82dccacee27f67e8df14df91c1f3b7.tar.zst godot-77cc0a023b82dccacee27f67e8df14df91c1f3b7.zip | |
attemp to fix #15870
(cherry picked from commit 517ff5c8d71884a09114191ac79bf8c990f391ca)
Diffstat (limited to '')
| -rw-r--r-- | scene/resources/style_box.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 6811517ea..de75bb397 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); |
