mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
grid: reflow: get number of spacers to insert from the old grid
When checking if we're breaking in the middle of a multi-column character, we counted spacers starting from the break point. But, the character may be wider than that. Use the fact that the spacers cells encode how many *more* there are after them; when we get to the first one, we know exactly how wide the character is.
This commit is contained in:
parent
9840204097
commit
d7e8f29ee2
1 changed files with 1 additions and 1 deletions
2
grid.c
2
grid.c
|
|
@ -1056,8 +1056,8 @@ grid_resize_and_reflow(
|
||||||
from + amount < old_cols &&
|
from + amount < old_cols &&
|
||||||
old_row->cells[from + amount].wc >= CELL_SPACER + 1))
|
old_row->cells[from + amount].wc >= CELL_SPACER + 1))
|
||||||
{
|
{
|
||||||
|
spacers = old_row->cells[from + amount].wc - CELL_SPACER + 1;
|
||||||
amount--;
|
amount--;
|
||||||
spacers++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xassert(
|
xassert(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue