diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-07 13:49:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-07 13:49:33 +0200 |
commit | ba541bceca806a53070a4fd54955ac4a63c1633a (patch) | |
tree | a03f55aa6d660a7c3659705348842a3e5b208e54 /scene/gui | |
parent | 904e3100aceee7560e24ae1293c5b8a1e6201d55 (diff) | |
parent | e0b5b218638df5b7b2998233182a7d8a1118e717 (diff) |
Merge pull request #31077 from qarmin/coverity_bugs
Change some code proposed by Coverity and Cppcheck
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 11 | ||||
-rw-r--r-- | scene/gui/control.h | 1 |
2 files changed, 0 insertions, 12 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 5ec6c68163..3246b9f3ec 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1772,17 +1772,6 @@ void Control::set_global_position(const Point2 &p_point, bool p_keep_margins) { set_position(inv.xform(p_point), p_keep_margins); } -Rect2 Control::_compute_child_rect(const float p_anchors[4], const float p_margins[4]) const { - - Rect2 anchorable = get_parent_anchorable_rect(); - Rect2 result = anchorable; - for (int i = 0; i < 4; i++) { - result.grow_margin((Margin)i, p_anchors[i] * anchorable.get_size()[i % 2] + p_margins[i]); - } - - return result; -} - void Control::_compute_anchors(Rect2 p_rect, const float p_margins[4], float (&r_anchors)[4]) { Size2 parent_rect_size = get_parent_anchorable_rect().size; diff --git a/scene/gui/control.h b/scene/gui/control.h index 1a59a6d2e4..eae889a667 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -230,7 +230,6 @@ private: void _update_scroll(); void _resize(const Size2 &p_size); - Rect2 _compute_child_rect(const float p_anchors[4], const float p_margins[4]) const; void _compute_margins(Rect2 p_rect, const float p_anchors[4], float (&r_margins)[4]); void _compute_anchors(Rect2 p_rect, const float p_margins[4], float (&r_anchors)[4]); |