diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-08-05 16:26:37 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-08-05 16:26:37 +0000 |
| commit | aaf5894ad9272698cfafeb8e299b925fb9554417 (patch) | |
| tree | 62cea6ec7e4b0a0ec034cb38daf49af4d4075370 /render.c | |
| parent | Add support for xdg_toplevel.wm_capabilities (diff) | |
grid: get rid of empty row at the bottom after reflowing
When the window is resized and we reflow the text, we ended up
inserting an empty row at the bottom.
This happens whenever the actual last row has a hard linebreak (which
almost always is the case); we then end the reflow with a line break,
causing an extra, empty, row to be allocated and inserted.
This patch fixes this by detecting when:
1) the last row is empty
2) the next to last row has a hard line break
In this case, we roll back the last line break, by adjusting the new
offset we just calculated, and free:ing the empty row.
TODO: it would be nice if we could detect this in the reflow loop
instead, and avoid doing the last line break all together. I haven’t
yet been able to find a way to do this correctly.
Closes #1108
Diffstat (limited to 'render.c')
0 files changed, 0 insertions, 0 deletions
