diff options
author | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2023-02-09 23:14:46 +0100 |
---|---|---|
committer | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2023-02-10 00:25:45 +0100 |
commit | d249370cd7710a927c159e8ff9d60fabf4907792 (patch) | |
tree | 37df9e19e6cb6f0164a122c9fc53a6d3abe6c1ad /servers | |
parent | 5c1295dc20323ee1596369b5bcf91ba6a9383336 (diff) |
Fix crash in editor when setting `SubViewport.size` to zero
`Viewport::_set_size` now verifies, that the minimum size is at least 2x2.
Also fix `RendererViewport::viewport_set_size` fail condition.
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/renderer_viewport.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index aecd0593bc..d251a81427 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -844,7 +844,7 @@ void RendererViewport::viewport_set_scaling_3d_scale(RID p_viewport, float p_sca } void RendererViewport::viewport_set_size(RID p_viewport, int p_width, int p_height) { - ERR_FAIL_COND(p_width < 0 && p_height < 0); + ERR_FAIL_COND(p_width < 0 || p_height < 0); Viewport *viewport = viewport_owner.get_or_null(p_viewport); ERR_FAIL_COND(!viewport); |