pixman: update and fix PointerConstraint
This commit is contained in:
parent
891eb38b33
commit
84f5283889
2 changed files with 5 additions and 6 deletions
2
deps/zig-pixman
vendored
2
deps/zig-pixman
vendored
|
@ -1 +1 @@
|
|||
Subproject commit f8e682ac2f640368ebb414aa2e7db6a2be1b179e
|
||||
Subproject commit 9acac698e073ff54b09a62fecb144de326f67626
|
|
@ -85,12 +85,11 @@ fn constrainToRegion(self: *Self) void {
|
|||
var box: pixman.Box32 = undefined;
|
||||
|
||||
if (!self.constraint.region.containsPoint(cx, cy, &box)) {
|
||||
var nRects: c_int = undefined;
|
||||
const rects = self.constraint.region.rectangles(&nRects);
|
||||
const rects = self.constraint.region.rectangles();
|
||||
|
||||
if (nRects > 0) {
|
||||
const new_cx = @intToFloat(f64, view.current.box.x + rects.x1 + @divFloor(rects.x2, 2));
|
||||
const new_cy = @intToFloat(f64, view.current.box.y + rects.y1 + @divFloor(rects.y2, 2));
|
||||
if (rects.len > 0) {
|
||||
const new_cx = @intToFloat(f64, view.current.box.x + rects[0].x1 + @divFloor(rects[0].x2, 2));
|
||||
const new_cy = @intToFloat(f64, view.current.box.y + rects[0].y1 + @divFloor(rects[0].y2, 2));
|
||||
|
||||
self.cursor.wlr_cursor.warpClosest(null, new_cx, new_cy);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue