mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
Constrain the mouse cursor to keep it inside the screen rect.
This commit is contained in:
parent
b95aa18315
commit
9bc7b128b2
3 changed files with 23 additions and 6 deletions
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
class Rect;
|
||||
|
||||
class Point {
|
||||
public:
|
||||
Point() { }
|
||||
|
@ -22,6 +24,8 @@ public:
|
|||
moveBy(delta.x(), delta.y());
|
||||
}
|
||||
|
||||
void constrain(const Rect&);
|
||||
|
||||
bool operator==(const Point& other) const
|
||||
{
|
||||
return m_x == other.m_x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue