const dim = @import("dimensions.zig"); const pane = @import("pane.zig"); const term = @import("term.zig"); const borders = @import("borders.zig"); const Pane = pane.Pane; const TermIO = term.TermIO; pub const HorizontalLine = struct { pane: Pane, border: borders.Border, pub fn create(mem: *HorizontalLine, border: borders.Border) *Pane { mem.border = border; mem.pane = Pane{ .vtable = .{ .draw = draw, }, }; return &mem.pane; } fn draw(pane_ptr: *Pane, term_io: *TermIO) !void { const self: *HorizontalLine = @fieldParentPtr("pane", pane_ptr); const y = pane_ptr.dimensions.size.height / 2; pane_ptr.cursor = .{ .x = 0, .y = y }; pane_ptr.moveCursor(term_io); for (0..pane_ptr.dimensions.size.width) |_| { term_io.print("{u}", .{self.border.top}); } } }; pub const VerticalLine = struct { pane: Pane, };