mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
LibGfx: Correct off by one error in Point::constrain()
Previously, the y value would be clamped to a value one less than necessary.
This commit is contained in:
parent
ea0b527675
commit
fc137a7827
1 changed files with 2 additions and 2 deletions
|
@ -15,8 +15,8 @@ namespace Gfx {
|
|||
template<typename T>
|
||||
void Point<T>::constrain(Rect<T> const& rect)
|
||||
{
|
||||
m_x = AK::clamp<T>(x(), rect.left(), rect.right());
|
||||
m_y = AK::clamp<T>(y(), rect.top(), rect.bottom());
|
||||
m_x = AK::clamp<T>(x(), rect.left(), rect.left() + rect.width());
|
||||
m_y = AK::clamp<T>(y(), rect.top(), rect.top() + rect.height());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue