Skip to content

Commit

Permalink
Fixed: Camera3D has an incorrect shape before opening the 2D tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush-singla27 committed Jan 10, 2023
1 parent bc5d67c commit 0cc3159
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,8 @@ bool Viewport::_is_size_allocated() const {
Rect2 Viewport::get_visible_rect() const {
Rect2 r;

if (size == Size2()) {
r = Rect2(Point2(), DisplayServer::get_singleton()->window_get_size());
if (is_inside_tree() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->get_parent() == get_viewport()) {
r = Rect2(Point2(), Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height")));
} else {
r = Rect2(Point2(), size);
}
Expand Down

0 comments on commit 0cc3159

Please sign in to comment.