AmendHub

Download (as of this amendment):

jcs

/

textview

/

amendments

/

51

TVResize: Clear line information from all chunks before recalculating


jcs made amendment 51 over 2 years ago
--- textview.c Wed Nov 13 14:40:08 2024 +++ textview.c Wed Nov 13 16:26:18 2024 @@ -226,6 +226,7 @@ TVResize(TVHandle tvh) struct TVRec *tv; long width, height, n; struct TVLine *line; + struct TVChunk *chunk; BigRect visible; long nline; unsigned long top_start; @@ -278,6 +279,15 @@ TVResize(TVHandle tvh) tv->nlines = 0; tv->last_space = 0; + for (chunk = TVGetChunk(tv, tv->first_chunk); chunk != NULL; + chunk = TVGetChunk(tv, chunk->next_chunk)) { + chunk->start_line = 0; + chunk->end_line = 0; + chunk->start_left = 0; + chunk->end_right = 0; + chunk->need_recalc = true; + } + if (!TVCalcLinesLocked(tv, true)) { /* XXX: if this fails, what are we supposed to do? */ TVUnlock(tv);