diff options
author | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-03-16 16:28:11 +0100 |
---|---|---|
committer | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-03-16 16:28:11 +0100 |
commit | 7451fa63f2d9d8fb40d7d62a22bbc1368479a5e8 (patch) | |
tree | 22d1b5a709a0ce9341ef3a3f8c674cbf952f1c64 /scene/main | |
parent | b1fbd8ab40fa133b048fe49928f0a8f1e9bd8527 (diff) |
Simplify always true conditional
get_viewport() is always true, because is_inside_tree() is true.
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/canvas_item.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 1d263ba858..ec0821557b 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -995,12 +995,7 @@ Transform2D CanvasItem::get_viewport_transform() const { ERR_FAIL_COND_V(!is_inside_tree(), Transform2D()); if (canvas_layer) { - if (get_viewport()) { - return get_viewport()->get_final_transform() * canvas_layer->get_transform(); - } else { - return canvas_layer->get_transform(); - } - + return get_viewport()->get_final_transform() * canvas_layer->get_transform(); } else { return get_viewport()->get_final_transform() * get_viewport()->get_canvas_transform(); } |