diff --git a/src/Screen.zig b/src/Screen.zig index 1a6641d..2ef3da5 100644 --- a/src/Screen.zig +++ b/src/Screen.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const assert = std.debug.assert; const Cell = @import("cell.zig").Cell; @@ -38,6 +39,6 @@ pub fn writeCell(self: *Screen, cell: Cell, row: usize, col: usize) void { return; } const i = (col * self.width) + row; - std.debug.assert(i < self.buf.len); + assert(i < self.buf.len); self.buf[i] = cell; } diff --git a/src/Window.zig b/src/Window.zig index de1d128..3861651 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -10,15 +10,20 @@ pub const Size = union(enum) { limit: usize, }; +/// horizontal offset from the screen x_off: usize, +/// vertical offset from the screen y_off: usize, +/// width of the window. This can't be larger than the terminal screen width: usize, +/// height of the window. This can't be larger than the terminal screen height: usize, screen: *Screen, /// Creates a new window with offset relative to parent and size clamped to the -/// parents' size +/// parent's size. Windows do not retain a reference to their parent and are +/// unaware of resizes. pub fn initChild( self: *Window, x_off: usize,