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,