diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-27 11:10:59 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-27 11:11:37 +0200 |
| commit | 9b1197feb3cb0aa8904180b950992d602d57ce41 (patch) | |
| tree | 7a15a6c45481858f412a4a29c7fe1a595722654d | |
| parent | 2b0b32c030888f74c7ae4198a98f639143e8b6f0 (diff) | |
| download | river-9b1197feb3cb0aa8904180b950992d602d57ce41.tar.gz river-9b1197feb3cb0aa8904180b950992d602d57ce41.tar.xz | |
Fix application of exclusive zones
Fixes https://github.com/ifreund/river/issues/13
| -rw-r--r-- | src/output.zig | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/output.zig b/src/output.zig index 7933831..7ef053f 100644 --- a/src/output.zig +++ b/src/output.zig @@ -235,11 +235,14 @@ pub const Output = struct { } // Apply offsets from borders and padding - new_box.x += @intCast(i32, border_width + outer_padding + view_padding); - new_box.y += @intCast(i32, border_width + outer_padding + view_padding); - - new_box.width -= (border_width + view_padding) * 2; - new_box.height -= (border_width + view_padding) * 2; + const xy_offset = @intCast(i32, border_width + outer_padding + view_padding); + new_box.x += self.usable_box.x + xy_offset; + new_box.y += self.usable_box.y + xy_offset; + + // Reduce size to allow space for borders/padding + const delta_size = (border_width + view_padding) * 2; + new_box.width -= delta_size; + new_box.height -= delta_size; // Set the view's pending box to the new dimensions view.pending_box = new_box; |
