From 5457e91b37b39546f3b9d86981f5e04b1cf136bf Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Thu, 6 Mar 2025 22:07:39 +0100 Subject: [PATCH] fix(container/grow_size): respect vertical / horizontal provided dimensions --- examples/layouts/mixed.zig | 7 ++++++- src/container.zig | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/layouts/mixed.zig b/examples/layouts/mixed.zig index 6b93f25..e4251cc 100644 --- a/examples/layouts/mixed.zig +++ b/examples/layouts/mixed.zig @@ -71,7 +71,12 @@ pub fn main() !void { .rectangle = .{ .fill = .yellow }, }, .{})); } else { - try column.append(try App.Container.init(allocator, .{}, .{})); + try column.append(try App.Container.init(allocator, .{ + .size = .{ + .dim = .{ .y = 5 }, + // .grow = .horizontal, + }, + }, .{})); } try column.append(try App.Container.init(allocator, .{ .rectangle = .{ .fill = .blue }, diff --git a/src/container.zig b/src/container.zig index a6a468a..adef5d5 100644 --- a/src/container.zig +++ b/src/container.zig @@ -690,10 +690,10 @@ pub fn Container(comptime Event: type) type { .fixed => this.properties.size.dim, .horizontal => .{ .x = @max(size.x, this.properties.size.dim.x), - .y = size.y, + .y = this.properties.size.dim.y, }, .vertical => .{ - .x = size.x, + .x = this.properties.size.dim.x, .y = @max(size.y, this.properties.size.dim.y), }, };