Skip to content

Commit

Permalink
[共通] fix #1118
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Nov 13, 2023
1 parent 9bf5dd4 commit 7239925
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions Siv3D/include/Siv3D/detail/Rect.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions Siv3D/include/Siv3D/detail/RectF.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7239925

Please sign in to comment.