From c8b0656d7f840d8d53c5cf25482b54390800fd56 Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Fri, 28 Nov 2025 15:29:54 +0100 Subject: [PATCH] mod(container): integrate `minSize` call when `fit_size` is calculated --- src/container.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/container.zig b/src/container.zig index 638ef64..5835a95 100644 --- a/src/container.zig +++ b/src/container.zig @@ -685,7 +685,7 @@ pub fn Container(Model: type, Event: type) type { } /// Resize all fit sized `Containers` to the necessary size required by its child elements. - fn fit_resize(this: *@This()) Point { + fn fit_resize(this: *@This(), model: *const Model) Point { // NOTE this is supposed to be a simple and easy to understand algorithm, there are currently no optimizations done const layout = this.properties.layout; var size: Point = switch (layout.direction) { @@ -723,7 +723,7 @@ pub fn Container(Model: type, Event: type) type { } } - size = this.minSize(&.{}, size); + size = this.minSize(model, size); // assign currently calculated size this.size = switch (this.properties.size.grow) { .both => .max(size, this.properties.size.dim), @@ -890,7 +890,7 @@ pub fn Container(Model: type, Event: type) type { pub fn resize(this: *@This(), model: *const Model, size: Point) void { // NOTE assume that this function is only called for the root `Container` this.size = size; - const fit_size = this.fit_resize(); + const fit_size = this.fit_resize(model); this.size = switch (this.properties.size.grow) { .both => .max(size, fit_size), .fixed => fit_size,