feat: add libvaxis renderer
This commit is contained in:
parent
b15fa47f30
commit
1cd3cb17ce
32 changed files with 1559 additions and 516 deletions
|
@ -195,7 +195,7 @@ fn animate(self: *Self) bool {
|
|||
else
|
||||
frame;
|
||||
|
||||
smooth_block_at(self.plane, pos);
|
||||
smooth_block_at(&self.plane, pos);
|
||||
return false;
|
||||
// return pos != 0;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ const eighths_l = [_][]const u8{ "█", "▉", "▊", "▋", "▌", "▍", "▎"
|
|||
const eighths_r = [_][]const u8{ " ", "▕", "🮇", "🮈", "▐", "🮉", "🮊", "🮋" };
|
||||
const eighths_c = eighths_l.len;
|
||||
|
||||
fn smooth_block_at(plane: Plane, pos: u64) void {
|
||||
fn smooth_block_at(plane: *Plane, pos: u64) void {
|
||||
const blk = @mod(pos, eighths_c) + 1;
|
||||
const l = eighths_l[eighths_c - blk];
|
||||
const r = eighths_r[eighths_c - blk];
|
||||
|
|
|
@ -3,7 +3,6 @@ const Allocator = std.mem.Allocator;
|
|||
const tp = @import("thespian");
|
||||
const tracy = @import("tracy");
|
||||
const root = @import("root");
|
||||
const egc = @import("renderer").egc;
|
||||
|
||||
const Plane = @import("renderer").Plane;
|
||||
const style = @import("renderer").style;
|
||||
|
@ -25,9 +24,9 @@ pub fn create(a: Allocator, parent: Plane) !Widget {
|
|||
});
|
||||
}
|
||||
|
||||
pub fn layout(_: *void, _: *Button.State(void)) Widget.Layout {
|
||||
pub fn layout(_: *void, btn: *Button.State(void)) Widget.Layout {
|
||||
const name = tui.get_mode();
|
||||
const width = egc.chunk_width(name, 0);
|
||||
const width = btn.plane.egc_chunk_width(name, 0);
|
||||
const padding: usize = if (is_mini_mode()) 3 else 2;
|
||||
return .{ .static = width + padding };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue