fix(container/grow_size): respect vertical / horizontal provided dimensions
This commit is contained in:
@@ -71,7 +71,12 @@ pub fn main() !void {
|
|||||||
.rectangle = .{ .fill = .yellow },
|
.rectangle = .{ .fill = .yellow },
|
||||||
}, .{}));
|
}, .{}));
|
||||||
} else {
|
} else {
|
||||||
try column.append(try App.Container.init(allocator, .{}, .{}));
|
try column.append(try App.Container.init(allocator, .{
|
||||||
|
.size = .{
|
||||||
|
.dim = .{ .y = 5 },
|
||||||
|
// .grow = .horizontal,
|
||||||
|
},
|
||||||
|
}, .{}));
|
||||||
}
|
}
|
||||||
try column.append(try App.Container.init(allocator, .{
|
try column.append(try App.Container.init(allocator, .{
|
||||||
.rectangle = .{ .fill = .blue },
|
.rectangle = .{ .fill = .blue },
|
||||||
|
|||||||
@@ -690,10 +690,10 @@ pub fn Container(comptime Event: type) type {
|
|||||||
.fixed => this.properties.size.dim,
|
.fixed => this.properties.size.dim,
|
||||||
.horizontal => .{
|
.horizontal => .{
|
||||||
.x = @max(size.x, this.properties.size.dim.x),
|
.x = @max(size.x, this.properties.size.dim.x),
|
||||||
.y = size.y,
|
.y = this.properties.size.dim.y,
|
||||||
},
|
},
|
||||||
.vertical => .{
|
.vertical => .{
|
||||||
.x = size.x,
|
.x = this.properties.size.dim.x,
|
||||||
.y = @max(size.y, this.properties.size.dim.y),
|
.y = @max(size.y, this.properties.size.dim.y),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user