diff --git a/src/container.zig b/src/container.zig index a2ffe29..33cb5d4 100644 --- a/src/container.zig +++ b/src/container.zig @@ -346,8 +346,8 @@ pub const Layout = packed struct { for (0..children.len - 1) |idx| { const child = children[idx]; const anchor = switch (this.direction) { - .horizontal => ((child.size.anchor.row -| size.anchor.row) * size.cols) + child.size.anchor.col + child.size.cols + gap -| size.anchor.col, - .vertical => ((child.size.anchor.row + child.size.rows + gap -| size.anchor.row) * size.cols) + child.size.anchor.col -| size.anchor.col, + .horizontal => ((@as(usize, child.size.anchor.row) -| @as(usize, size.anchor.row)) * @as(usize, size.cols)) + @as(usize, child.size.anchor.col) + @as(usize, child.size.cols) + gap -| @as(usize, size.anchor.col), + .vertical => ((@as(usize, child.size.anchor.row) + @as(usize, child.size.rows) + gap -| @as(usize, size.anchor.row)) * @as(usize, size.cols)) + @as(usize, child.size.anchor.col) -| @as(usize, size.anchor.col), }; switch (this.direction) {