diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-04 23:26:15 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-04 23:26:15 +0200 |
| commit | ea88cca35f29fd4fef9f6fa4035950685fa4a5fd (patch) | |
| tree | 506eae4985ae0eaf45974a110ce0ad8732ff5733 /src/output.zig | |
| parent | 149dd488a942188e0cfe3de30032e09e66d1bb6c (diff) | |
| download | river-ea88cca35f29fd4fef9f6fa4035950685fa4a5fd.tar.gz river-ea88cca35f29fd4fef9f6fa4035950685fa4a5fd.tar.xz | |
Take future borders into account for surface size
Diffstat (limited to 'src/output.zig')
| -rw-r--r-- | src/output.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/output.zig b/src/output.zig index 0ab7c9d..3106a74 100644 --- a/src/output.zig +++ b/src/output.zig @@ -109,10 +109,10 @@ pub const Output = struct { // and need to render that buffer until the transaction is complete. if (view.stashed_buffer) |buffer| { var box = c.wlr_box{ - .x = view.current_box.x, - .y = view.current_box.y, - .width = @intCast(c_int, view.current_box.width), - .height = @intCast(c_int, view.current_box.height), + .x = view.current_box.x + @intCast(i32, view.root.border_width), + .y = view.current_box.y + @intCast(i32, view.root.border_width), + .width = @intCast(c_int, view.current_box.width - view.root.border_width * 2), + .height = @intCast(c_int, view.current_box.height - view.root.border_width * 2), }; // Scale the box to the output's current scaling factor @@ -176,14 +176,14 @@ pub const Output = struct { var ox: f64 = 0.0; var oy: f64 = 0.0; c.wlr_output_layout_output_coords(view.root.wlr_output_layout, output, &ox, &oy); - ox += @intToFloat(f64, view.current_box.x + sx); - oy += @intToFloat(f64, view.current_box.y + sy); + ox += @intToFloat(f64, view.current_box.x + @intCast(i32, view.root.border_width) + sx); + oy += @intToFloat(f64, view.current_box.y + @intCast(i32, view.root.border_width) + sy); var box = c.wlr_box{ .x = @floatToInt(c_int, ox), .y = @floatToInt(c_int, oy), - .width = @intCast(c_int, surface.current.width), - .height = @intCast(c_int, surface.current.height), + .width = surface.current.width, + .height = surface.current.height, }; // Scale the box to the output's current scaling factor |
