ref(container): split size and position calculations
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 34s
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 34s
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user