From 74721c967443a64f36ea8a1fad126430bf84d3ec Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 24 May 2020 15:29:39 +0200 Subject: [PATCH] Fix x/y offset in full layout Fixes https://github.com/ifreund/river/issues/13 --- src/Output.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Output.zig b/src/Output.zig index 285b365..a32c000 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -374,7 +374,8 @@ pub fn layoutFull(self: *Self, visible_count: u32, output_tags: u32) void { (outer_padding * 2) - (border_width * 2) - (view_padding * 2); const layout_height = @intCast(u32, self.usable_box.height) - (outer_padding * 2) - (border_width * 2) - (view_padding * 2); - const xy_offset = @intCast(i32, outer_padding + border_width + view_padding); + const x_offset = self.usable_box.x + @intCast(i32, outer_padding + border_width + view_padding); + const y_offset = self.usable_box.y + @intCast(i32, outer_padding + border_width + view_padding); var i: u32 = 0; var it = ViewStack(View).pendingIterator(self.views.first, output_tags); @@ -387,8 +388,8 @@ pub fn layoutFull(self: *Self, visible_count: u32, output_tags: u32) void { var new_box: Box = undefined; new_box = .{ - .x = xy_offset, - .y = xy_offset, + .x = x_offset, + .y = y_offset, .width = layout_width, .height = layout_height, };