mod(size): rename merge function to add; new max function
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m6s

This commit is contained in:
2025-02-27 14:17:19 +01:00
parent 54ce697e91
commit 53b69f034c
3 changed files with 54 additions and 12 deletions

View File

@@ -595,7 +595,7 @@ pub fn Container(comptime Event: type) type {
const len: u16 = @truncate(this.elements.items.len);
if (len > 0) {
for (this.elements.items) |element| {
size = size.merge(element.minSize());
size = size.add(element.minSize());
}
var gap = this.properties.layout.gap;
if (this.properties.layout.separator.enabled) gap += 1;
@@ -605,10 +605,7 @@ pub fn Container(comptime Event: type) type {
.vertical => size.rows += gap * (len - 1),
}
}
return .{
.cols = @max(size.cols, this.properties.min_size.cols),
.rows = @max(size.rows, this.properties.min_size.rows),
};
return size.max(this.properties.min_size);
}
pub fn handle(this: *@This(), event: Event) !void {