this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

ScrollView: usize -> u16 casts

authored by

Jari Vetoniemi and committed by
Tim Culverhouse
9036ee27 a6184886

+4 -4
+4 -4
src/widgets/ScrollView.zig
··· 115 115 pub fn writeCell(self: *@This(), parent: vaxis.Window, col: usize, row: usize, cell: vaxis.Cell) void { 116 116 const b = self.bounds(parent); 117 117 if (!b.inside(col, row)) return; 118 - const win = parent.child(.{ .width = b.x2 - b.x1, .height = b.y2 - b.y1 }); 119 - win.writeCell(col -| self.scroll.x, row -| self.scroll.y, cell); 118 + const win = parent.child(.{ .width = @intCast(b.x2 - b.x1), .height = @intCast(b.y2 - b.y1) }); 119 + win.writeCell(@intCast(col -| self.scroll.x), @intCast(row -| self.scroll.y), cell); 120 120 } 121 121 122 122 /// Use this function instead of `Window.readCell` to read the correct cell in scrolling context. 123 123 pub fn readCell(self: *@This(), parent: vaxis.Window, col: usize, row: usize) ?vaxis.Cell { 124 124 const b = self.bounds(parent); 125 125 if (!b.inside(col, row)) return; 126 - const win = parent.child(.{ .width = b.width, .height = b.height }); 127 - return win.readCell(col -| self.scroll.x, row -| self.scroll.y); 126 + const win = parent.child(.{ .width = @intCast(b.x2 - b.x1), .height = @intCast(b.y2 - b.y1) }); 127 + return win.readCell(@intCast(col -| self.scroll.x), @intCast(row -| self.scroll.y)); 128 128 }