mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 07:01:57 -07:00
cursor: move to a hyprland impl
This moves wlr_cursor to a completely new impl mostly under CPointerManager Also adds beginSimple to OpenGL for simple render passes (e.g. cursor)
This commit is contained in:
@@ -142,6 +142,9 @@ bool CRegion::empty() const {
|
||||
}
|
||||
|
||||
Vector2D CRegion::closestPoint(const Vector2D& vec) const {
|
||||
if (containsPoint(vec))
|
||||
return vec;
|
||||
|
||||
double bestDist = __FLT_MAX__;
|
||||
Vector2D leader = vec;
|
||||
|
||||
@@ -162,7 +165,7 @@ Vector2D CRegion::closestPoint(const Vector2D& vec) const {
|
||||
else
|
||||
y = vec.y;
|
||||
|
||||
double distance = sqrt(pow(x, 2) + pow(y, 2));
|
||||
double distance = pow(x, 2) + pow(y, 2);
|
||||
if (distance < bestDist) {
|
||||
bestDist = distance;
|
||||
leader = {x, y};
|
||||
|
Reference in New Issue
Block a user