fix child scroll
This commit is contained in:
parent
b78ac957f4
commit
f06c11fc84
1 changed files with 2 additions and 2 deletions
|
@ -438,10 +438,10 @@ pub fn scroll(self: Window, n: u16) void {
|
|||
var row: u16 = @max(self.y_off, 0);
|
||||
const first_col: u16 = @max(self.x_off, 0);
|
||||
while (row < self.height - n) : (row += 1) {
|
||||
const dst_start = (row * self.width) + first_col;
|
||||
const dst_start = (row * self.screen.width) + first_col;
|
||||
const dst_end = dst_start + self.width;
|
||||
|
||||
const src_start = ((row + n) * self.width) + first_col;
|
||||
const src_start = ((row + n) * self.screen.width) + first_col;
|
||||
const src_end = src_start + self.width;
|
||||
@memcpy(self.screen.buf[dst_start..dst_end], self.screen.buf[src_start..src_end]);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue