diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-01-13 17:05:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-13 17:05:36 +0100 |
commit | 63e980f746d69bb1cd9b1712ec75b416e48b518d (patch) | |
tree | 0d5c7c4363079ced4c97e16c99e899f89b8dd916 | |
parent | 5f22422d99f8da2216d03d90355fec7016286255 (diff) | |
parent | 0b632be4a931f1322e0ab36754c454fd3677bfa6 (diff) |
Merge pull request #15655 from endragor/fix-get-parent-range
Fix get_parent_range to return 0 when there is no parent
-rw-r--r-- | scene/gui/control.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 6d7da7cdd0..d9d033dfb9 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1325,7 +1325,7 @@ float Control::_get_parent_range(int p_idx) const { if (!is_inside_tree()) { - return 1.0; + return 0; } if (data.parent_canvas_item) { @@ -1334,7 +1334,7 @@ float Control::_get_parent_range(int p_idx) const { return get_viewport()->get_visible_rect().size[p_idx & 1]; } - return 1.0; + return 0; } float Control::_get_range(int p_idx) const { |