mod(renderer): initial version of double buffer intermediate renderer

This branch will implement the necessary changes for the widgets and
their implementations to use the new renderer correctly.
This commit is contained in:
2025-01-30 20:53:01 +01:00
parent c83ceff925
commit 3decc541a9
9 changed files with 184 additions and 225 deletions

View File

@@ -20,7 +20,7 @@ pub const ReportMode = enum {
pub fn getTerminalSize() Size {
var ws: std.posix.winsize = undefined;
_ = std.posix.system.ioctl(std.posix.STDIN_FILENO, std.posix.T.IOCGWINSZ, @intFromPtr(&ws));
return .{ .cols = ws.col, .rows = ws.row };
return .{ .cols = ws.col - 1, .rows = ws.row - 1 };
}
pub fn saveScreen() !void {
@@ -126,8 +126,8 @@ pub fn getCursorPosition() !Position {
}
return .{
.row = try std.fmt.parseInt(u16, row[0..ridx], 10),
.col = try std.fmt.parseInt(u16, col[0..cidx], 10),
.row = try std.fmt.parseInt(u16, row[0..ridx], 10) - 1,
.col = try std.fmt.parseInt(u16, col[0..cidx], 10) - 1,
};
}