From b401b5ece883d41ef379dad7caea8c9c140d3021 Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Mon, 7 Jul 2025 23:08:06 +0200 Subject: [PATCH] lint(container): style --- src/container.zig | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/container.zig b/src/container.zig index 1b19eba..ebb2595 100644 --- a/src/container.zig +++ b/src/container.zig @@ -595,9 +595,7 @@ pub fn Container(comptime Event: type) type { } pub fn deinit(this: *const @This()) void { - for (this.elements.items) |*element| { - element.deinit(); - } + for (this.elements.items) |*element| element.deinit(); this.elements.deinit(); } @@ -774,6 +772,7 @@ pub fn Container(comptime Event: type) type { for (this.elements.items) |child| { if (child.properties.size.grow == .fixed) continue; + switch (layout.direction) { .horizontal => if (child.properties.size.grow == .vertical) continue, .vertical => if (child.properties.size.grow == .horizontal) continue, @@ -795,10 +794,8 @@ pub fn Container(comptime Event: type) type { size_to_correct = @min(size_to_correct, remainder / growable_children); var overflow: u16 = 0; - if (size_to_correct == 0 and remainder > 0) { - // there is some overflow - overflow = remainder; - } + if (size_to_correct == 0 and remainder > 0) overflow = remainder; + for (this.elements.items) |*child| { const child_size = switch (layout.direction) { .horizontal => child.size.x,