window: saturate size, export Color

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-03-01 21:29:16 -06:00
parent c662de4df0
commit fa39f0a067
2 changed files with 3 additions and 2 deletions

View file

@ -48,10 +48,10 @@ pub fn initChild(
}, },
}; };
const resolved_height = switch (height) { const resolved_height = switch (height) {
.expand => self.height - y_off, .expand => self.height -| y_off,
.limit => |h| blk: { .limit => |h| blk: {
if (h + y_off > self.height) { if (h + y_off > self.height) {
break :blk self.height - y_off; break :blk self.height -| y_off;
} }
break :blk h; break :blk h;
}, },

View file

@ -9,6 +9,7 @@ pub const Cell = @import("Cell.zig");
pub const Segment = Cell.Segment; pub const Segment = Cell.Segment;
pub const PrintOptions = Window.PrintOptions; pub const PrintOptions = Window.PrintOptions;
pub const Style = Cell.Style; pub const Style = Cell.Style;
pub const Color = Cell.Color;
pub const Image = @import("Image.zig"); pub const Image = @import("Image.zig");
pub const Mouse = @import("Mouse.zig"); pub const Mouse = @import("Mouse.zig");
pub const Winsize = @import("Tty.zig").Winsize; pub const Winsize = @import("Tty.zig").Winsize;