ref(container): split size and position calculations
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 34s

This commit is contained in:
2025-03-04 19:53:28 +01:00
parent 65d7546efd
commit fc72cf4abb
14 changed files with 205 additions and 180 deletions

View File

@@ -92,11 +92,11 @@ pub fn main() !void {
.color = .light_blue,
.sides = .all,
},
.fixed_size = .{ .x = 200 },
.size = .{ .x = 200 },
}, .{}));
try container.append(try App.Container.init(allocator, .{
.rectangle = .{ .fill = .blue },
.fixed_size = .{ .x = 30 },
.size = .{ .x = 30 },
}, .{}));
defer container.deinit(); // also de-initializes the children
@@ -146,8 +146,7 @@ pub fn main() !void {
}
try renderer.resize();
container.reposition(.{});
container.resize(renderer.size);
container.resize(.{}, renderer.size);
try renderer.render(@TypeOf(container), &container);
try renderer.flush();
}