From 2094e0c3642c8354266f09e13b058f860e081bb0 Mon Sep 17 00:00:00 2001 From: Shem Sedrick Date: Sat, 12 Oct 2024 15:17:47 -0500 Subject: [PATCH] Adding saturating subtraction for w --- src/Window.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Window.zig b/src/Window.zig index dfd2ab3..5a61d1f 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -170,11 +170,11 @@ pub fn child(self: Window, opts: ChildOptions) Window { if (loc.top and loc.left) result.writeCell(0, 0, .{ .char = top_left, .style = style }); if (loc.top and loc.right) - result.writeCell(w - 1, 0, .{ .char = top_right, .style = style }); + result.writeCell(w -| 1, 0, .{ .char = top_right, .style = style }); if (loc.bottom and loc.left) result.writeCell(0, h -| 1, .{ .char = bottom_left, .style = style }); if (loc.bottom and loc.right) - result.writeCell(w - 1, h -| 1, .{ .char = bottom_right, .style = style }); + result.writeCell(w -| 1, h -| 1, .{ .char = bottom_right, .style = style }); const x_off: usize = if (loc.left) 1 else 0; const y_off: usize = if (loc.top) 1 else 0;