aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2022-03-28 12:10:18 +0200
committerIsaac Freund <mail@isaacfreund.com>2022-03-28 12:11:28 +0200
commitae349b0ce45b44b79a0a93e89c2cd05d24bb63d4 (patch)
tree9d53a7b19c1bd84b73b763b6803fb8a1f76d3661
parentaa684aa936e8e40625baeda6172d1a7fc6d76eb2 (diff)
downloadriver-ae349b0ce45b44b79a0a93e89c2cd05d24bb63d4.tar.gz
river-ae349b0ce45b44b79a0a93e89c2cd05d24bb63d4.tar.xz
layer-shell: fix overflow with large bottom margin
-rw-r--r--river/Output.zig12
1 files changed, 8 insertions, 4 deletions
diff --git a/river/Output.zig b/river/Output.zig
index 6f7a76a..4cfbd37 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -320,8 +320,10 @@ fn arrangeLayer(
new_box.width = current_state.desired_width;
} else {
assert(current_state.anchor.right);
- new_box.x = bounds.x + @intCast(i32, bounds.width - current_state.desired_width -
- current_state.margin.right);
+ new_box.x = bounds.x + @intCast(i32, bounds.width) -
+ @intCast(i32, current_state.desired_width) -
+ // TODO(wlroots) this type has been corrected to i32 for the next release
+ @intCast(i32, current_state.margin.right);
new_box.width = current_state.desired_width;
}
@@ -338,8 +340,10 @@ fn arrangeLayer(
new_box.height = current_state.desired_height;
} else {
assert(current_state.anchor.bottom);
- new_box.y = bounds.y + @intCast(i32, bounds.height - current_state.desired_height -
- current_state.margin.bottom);
+ new_box.y = bounds.y + @intCast(i32, bounds.height) -
+ @intCast(i32, current_state.desired_height) -
+ // TODO(wlroots) this type has been corrected to i32 for the next release
+ @intCast(i32, current_state.margin.bottom);
new_box.height = current_state.desired_height;
}