1
Fork 0
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:
Andreas Kling 2019-01-12 01:00:24 +01:00
parent b95aa18315
commit 9bc7b128b2
3 changed files with 23 additions and 6 deletions

View file

@ -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