From 7239925c4bf5b7be232b1dfbb102ece664329f84 Mon Sep 17 00:00:00 2001 From: Ryo Suzuki Date: Mon, 13 Nov 2023 17:20:46 +0900 Subject: [PATCH] =?UTF-8?q?[=E5=85=B1=E9=80=9A]=20fix=20#1118?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Siv3D/include/Siv3D/detail/Rect.ipp | 14 +++++++------- Siv3D/include/Siv3D/detail/RectF.ipp | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Siv3D/include/Siv3D/detail/Rect.ipp b/Siv3D/include/Siv3D/detail/Rect.ipp index bb15fb18a..4d4fdd70e 100644 --- a/Siv3D/include/Siv3D/detail/Rect.ipp +++ b/Siv3D/include/Siv3D/detail/Rect.ipp @@ -633,32 +633,32 @@ namespace s3d inline constexpr Rect::value_type Rect::leftX() const noexcept { - return x; + return pos.x; } inline constexpr Rect::value_type Rect::rightX() const noexcept { - return (x + w); + return (pos.x + size.x); } inline constexpr Rect::value_type Rect::topY() const noexcept { - return y; + return pos.y; } inline constexpr Rect::value_type Rect::bottomY() const noexcept { - return (y + h); + return (pos.y + size.y); } inline constexpr double Rect::centerX() const noexcept { - return (x + w * 0.5); + return (pos.x + size.x * 0.5); } inline constexpr double Rect::centerY() const noexcept { - return (y + h * 0.5); + return (pos.y + size.y * 0.5); } inline constexpr Rect::size_type Rect::tl() const noexcept @@ -708,7 +708,7 @@ namespace s3d inline constexpr Vec2 Rect::getRelativePoint(const double relativeX, const double relativeY) const noexcept { - return{ (x + w * relativeX), (y + h * relativeY) }; + return{ (pos.x + size.x * relativeX), (pos.y + size.y * relativeY) }; } inline constexpr Line Rect::top() const noexcept diff --git a/Siv3D/include/Siv3D/detail/RectF.ipp b/Siv3D/include/Siv3D/detail/RectF.ipp index b8988f4e2..8608ca8f6 100644 --- a/Siv3D/include/Siv3D/detail/RectF.ipp +++ b/Siv3D/include/Siv3D/detail/RectF.ipp @@ -644,32 +644,32 @@ namespace s3d inline constexpr RectF::value_type RectF::leftX() const noexcept { - return x; + return pos.x; } inline constexpr RectF::value_type RectF::rightX() const noexcept { - return (x + w); + return (pos.x + size.x); } inline constexpr RectF::value_type RectF::topY() const noexcept { - return y; + return pos.y; } inline constexpr RectF::value_type RectF::bottomY() const noexcept { - return (y + h); + return (pos.y + size.y); } inline constexpr RectF::value_type RectF::centerX() const noexcept { - return (x + w * 0.5); + return (pos.x + size.x * 0.5); } inline constexpr RectF::value_type RectF::centerY() const noexcept { - return (y + h * 0.5); + return (pos.y + size.y * 0.5); } inline constexpr RectF::size_type RectF::tl() const noexcept @@ -719,7 +719,7 @@ namespace s3d inline constexpr RectF::position_type RectF::getRelativePoint(const double relativeX, const double relativeY) const noexcept { - return{ (x + w * relativeX), (y + h * relativeY) }; + return{ (pos.x + size.x * relativeX), (pos.y + size.y * relativeY) }; } inline constexpr Line RectF::top() const noexcept