diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-04-13 15:26:50 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-04-24 17:03:56 +0200 |
commit | 4a140b61f17bbe742eb280be305366f7c597cd05 (patch) | |
tree | 2ebd85f887512ca7ebd71817c3a3825de26f3fc8 /scene | |
parent | d46cb8e65cf6f9356f190699b11d386719aba7ed (diff) |
Use Point2 consistently in Control methods
While Size2 and Point2 are just aliases,
which is why this doesn't fail compilation,
it's nice to have things consistent.
(cherry picked from commit 4fed87320cf8e1a87fc6c54bf15cef6f610e6091)
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/control.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 3ecb9c47c0..8aee6144fc 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -765,7 +765,7 @@ void Control::set_anchor_and_offset(Side p_side, real_t p_anchor, real_t p_pos, set_offset(p_side, p_pos); } -void Control::set_begin(const Size2 &p_point) { +void Control::set_begin(const Point2 &p_point) { ERR_FAIL_COND(!isfinite(p_point.x) || !isfinite(p_point.y)); if (data.offset[0] == p_point.x && data.offset[1] == p_point.y) { return; @@ -776,11 +776,11 @@ void Control::set_begin(const Size2 &p_point) { _size_changed(); } -Size2 Control::get_begin() const { - return Size2(data.offset[0], data.offset[1]); +Point2 Control::get_begin() const { + return Point2(data.offset[0], data.offset[1]); } -void Control::set_end(const Size2 &p_point) { +void Control::set_end(const Point2 &p_point) { if (data.offset[2] == p_point.x && data.offset[3] == p_point.y) { return; } @@ -790,8 +790,8 @@ void Control::set_end(const Size2 &p_point) { _size_changed(); } -Size2 Control::get_end() const { - return Size2(data.offset[2], data.offset[3]); +Point2 Control::get_end() const { + return Point2(data.offset[2], data.offset[3]); } void Control::set_h_grow_direction(GrowDirection p_direction) { @@ -1358,11 +1358,11 @@ void Control::set_grow_direction_preset(LayoutPreset p_preset) { /// Manual positioning. -void Control::_set_position(const Size2 &p_point) { +void Control::_set_position(const Point2 &p_point) { set_position(p_point); } -void Control::set_position(const Size2 &p_point, bool p_keep_offsets) { +void Control::set_position(const Point2 &p_point, bool p_keep_offsets) { if (p_keep_offsets) { _compute_anchors(Rect2(p_point, data.size_cache), data.offset, data.anchor); } else { |