diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-04-17 14:30:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 14:30:26 +0200 |
commit | 055ee1276f097727d1c0ba3c1c25a12981c20bfa (patch) | |
tree | cca05dc009a4bf552ed46db263ed355dc75e0bb6 | |
parent | b8b494a16c1c0741bab9b57d98a11ff9576d6907 (diff) | |
parent | 4fed87320cf8e1a87fc6c54bf15cef6f610e6091 (diff) | |
download | redot-engine-055ee1276f097727d1c0ba3c1c25a12981c20bfa.tar.gz |
Merge pull request #76029 from YuriSizov/control-we-are-not-the-same-you-and-i
Use Point2 consistently in Control methods
-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 8957a9492e..03f5146110 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 { |