From 4a140b61f17bbe742eb280be305366f7c597cd05 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Thu, 13 Apr 2023 15:26:50 +0200 Subject: 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) --- scene/gui/control.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scene') 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 { -- cgit v1.2.3