diff options
| author | novakne <hmachet@zoho.com> | 2021-04-22 07:46:17 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2021-04-22 10:33:28 +0200 |
| commit | 84f5283889589b8972a8e1554416abbd7e88e593 (patch) | |
| tree | 1b4702c6d50baec7cdfadebc7e1f030054a91f01 | |
| parent | 891eb38b33f9e0321ed7802ce41d747accb92536 (diff) | |
| download | river-84f5283889589b8972a8e1554416abbd7e88e593.tar.gz river-84f5283889589b8972a8e1554416abbd7e88e593.tar.xz | |
pixman: update and fix PointerConstraint
| m--------- | deps/zig-pixman | 0 | ||||
| -rw-r--r-- | river/PointerConstraint.zig | 9 |
2 files changed, 4 insertions, 5 deletions
diff --git a/deps/zig-pixman b/deps/zig-pixman -Subproject f8e682ac2f640368ebb414aa2e7db6a2be1b179 +Subproject 9acac698e073ff54b09a62fecb144de326f6762 diff --git a/river/PointerConstraint.zig b/river/PointerConstraint.zig index fc5cf20..3e9667f 100644 --- a/river/PointerConstraint.zig +++ b/river/PointerConstraint.zig @@ -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); } |
