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

@@ -86,12 +86,8 @@ pub fn Scrollable(Event: type) type {
.resize => |size| {
this.size = size;
// TODO: scrollbar space - depending on configuration and only if necessary?
const min_size = this.container.minSize();
this.container_size = .{
.anchor = size.anchor,
.cols = @max(min_size.cols, size.cols),
.rows = @max(min_size.rows, size.rows),
};
this.container_size = size.max(this.container.minSize());
this.container_size.anchor = size.anchor;
try this.container.handle(.{ .resize = this.container_size });
},
// TODO: other means to scroll except with the mouse? (i.e. Ctrl-u/d, k/j, etc.?)