mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
grid: refactor reflow
We've been trying to performance optimize reflow by "chunking" cells; try to gather as many as possible, and memcpy a chunk at once. The problem is that a) this quickly becomes very complex, and b) is very hard to get right for multi-column characters, especially when we need to truncate long ones due to the window being too small. Refactor, and once again walk and copy all cells one by one. This is slower, but at least it's correct.
This commit is contained in:
parent
c63202ee0e
commit
3d66db63cc
3 changed files with 88 additions and 151 deletions
6
render.c
6
render.c
|
|
@ -4190,7 +4190,7 @@ delayed_reflow_of_normal_grid(struct terminal *term)
|
|||
/* Reflow the original (since before the resize was started) grid,
|
||||
* to the *current* dimensions */
|
||||
grid_resize_and_reflow(
|
||||
term->interactive_resizing.grid,
|
||||
term->interactive_resizing.grid, term,
|
||||
term->interactive_resizing.new_rows, term->normal.num_cols,
|
||||
term->interactive_resizing.old_screen_rows, term->rows,
|
||||
term->selection.coords.end.row >= 0 ? ALEN(tracking_points) : 0,
|
||||
|
|
@ -4409,7 +4409,7 @@ render_resize(struct terminal *term, int width, int height, uint8_t opts)
|
|||
}
|
||||
|
||||
/* Don't shrink grid too much */
|
||||
const int min_cols = 7; /* See OSC-66 */
|
||||
const int min_cols = 2;
|
||||
const int min_rows = 1;
|
||||
|
||||
/* Minimum window size (must be divisible by the scaling factor)*/
|
||||
|
|
@ -4691,7 +4691,7 @@ render_resize(struct terminal *term, int width, int height, uint8_t opts)
|
|||
};
|
||||
|
||||
grid_resize_and_reflow(
|
||||
&term->normal, new_normal_grid_rows, new_cols, old_normal_rows, new_rows,
|
||||
&term->normal, term, new_normal_grid_rows, new_cols, old_normal_rows, new_rows,
|
||||
term->selection.coords.end.row >= 0 ? ALEN(tracking_points) : 0,
|
||||
tracking_points);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue