mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-01 07:15:32 -04:00
scrolling: hopefully fix bad damage update of items outside scrolling region
This commit is contained in:
parent
5e8c75aa38
commit
70743fddf4
1 changed files with 4 additions and 4 deletions
|
|
@ -240,8 +240,8 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows
|
||||||
int start = it->item.range.start - term->grid->offset;
|
int start = it->item.range.start - term->grid->offset;
|
||||||
int end __attribute__((unused)) = start + it->item.range.length;
|
int end __attribute__((unused)) = start + it->item.range.length;
|
||||||
|
|
||||||
if (start < region.start) {
|
if (start < region.start * term->cols) {
|
||||||
assert(end <= region.start);
|
assert(end <= region.start * term->cols);
|
||||||
it->item.range.start += rows * term->cols;
|
it->item.range.start += rows * term->cols;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -259,8 +259,8 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows
|
||||||
int start = it->item.range.start - term->grid->offset;
|
int start = it->item.range.start - term->grid->offset;
|
||||||
int end = start + it->item.range.length;
|
int end = start + it->item.range.length;
|
||||||
|
|
||||||
if (end > region.end) {
|
if (end > region.end * term->cols) {
|
||||||
assert(start >= region.end);
|
assert(start >= region.end * term->cols);
|
||||||
it->item.range.start += rows * term->cols;
|
it->item.range.start += rows * term->cols;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue