diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index ff8f0d05f10..68f5a252e52 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1331,11 +1331,11 @@ Matrix32 Viewport::_get_input_pre_xform() const { Matrix32 pre_xf; if (render_target) { - ERR_FAIL_COND_V(to_screen_rect.size.x==0,pre_xf); - ERR_FAIL_COND_V(to_screen_rect.size.y==0,pre_xf); + if (to_screen_rect!=Rect2()) { - pre_xf.elements[2]=-to_screen_rect.pos; - pre_xf.scale(rect.size/to_screen_rect.size); + pre_xf.elements[2]=-to_screen_rect.pos; + pre_xf.scale(rect.size/to_screen_rect.size); + } } else { pre_xf.elements[2]=-rect.pos;