mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
LibGfx+WindowServer: Ensure constrain-to-rect ends up inside the rect
This commit is contained in:
parent
4c2ad70066
commit
4b7639c3b5
Notes:
sideshowbarker
2024-07-17 00:59:43 +09:00
Author: https://github.com/BenWiederhake
Commit: 4b7639c3b5
Pull-request: https://github.com/SerenityOS/serenity/pull/18687
Reviewed-by: https://github.com/gmta ✅
2 changed files with 3 additions and 3 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.left() + rect.width());
|
||||
m_y = AK::clamp<T>(y(), rect.top(), rect.top() + rect.height());
|
||||
m_x = AK::clamp<T>(x(), rect.left(), rect.right());
|
||||
m_y = AK::clamp<T>(y(), rect.top(), rect.bottom());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue