summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index ff8f0d05f1..68f5a252e5 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;