fix(example/styles): provide necessary size for text display through the element
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 31s

This could also be done through the `resize` function interface of the
`Element` or the corresponding `Container` from the outside (as done in
this example - as the size is know at compile-time).
This commit is contained in:
2025-03-05 23:22:06 +01:00
parent 315cd8d23e
commit 2b9ab1e0fb

View File

@@ -111,6 +111,12 @@ pub fn main() !void {
var box = try App.Container.init(allocator, .{
.layout = .{ .direction = .vertical },
.size = .{
.dim = .{
.x = std.meta.fields(zterm.Style.Emphasis).len * TextStyles.text.len,
.y = (std.meta.fields(zterm.Color).len - 1) * (std.meta.fields(zterm.Color).len - 2),
},
},
}, text_styles.element());
defer box.deinit();