diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-29 15:33:19 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-29 15:33:19 +0300 |
commit | b1a03400b2d32cf3d82defe15ebe64a3cdcf6981 (patch) | |
tree | ec56e8c36de779659dfb95c1761c5891d4b37cde /src/ui/documentwidget.c | |
parent | 2578441c43544205991467720afdfdd0df1ecf4e (diff) |
VisBuf: Increase buffer size for scrolling; fixed glitches
Instead of 1.5x coverage, the buffer now has a full 2x.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 3b5ddb7c..07b359da 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -2040,10 +2040,9 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
2040 | fetchNextUnfetchedImage_DocumentWidget_(d)) { | 2040 | fetchNextUnfetchedImage_DocumentWidget_(d)) { |
2041 | return iTrue; | 2041 | return iTrue; |
2042 | } | 2042 | } |
2043 | const float amount = argLabel_Command(cmd, "full") ? 1.0f : 0.5f; | 2043 | const float amount = argLabel_Command(cmd, "full") != 0 ? 1.0f : 0.5f; |
2044 | smoothScroll_DocumentWidget_(d, | 2044 | smoothScroll_DocumentWidget_(d, |
2045 | dir * (amount * height_Rect(documentBounds_DocumentWidget_(d)) - | 2045 | dir * amount * height_Rect(documentBounds_DocumentWidget_(d)), |
2046 | 0 * lineHeight_Text(paragraph_FontId)), | ||
2047 | smoothDuration_DocumentWidget_); | 2046 | smoothDuration_DocumentWidget_); |
2048 | return iTrue; | 2047 | return iTrue; |
2049 | } | 2048 | } |
@@ -3391,7 +3390,7 @@ static void draw_DocumentWidget_(const iDocumentWidget *d) { | |||
3391 | const iRangei vis = visibleRange_DocumentWidget_(d); | 3390 | const iRangei vis = visibleRange_DocumentWidget_(d); |
3392 | const iRangei full = { 0, size_GmDocument(d->doc).y }; | 3391 | const iRangei full = { 0, size_GmDocument(d->doc).y }; |
3393 | reposition_VisBuf(visBuf, vis); | 3392 | reposition_VisBuf(visBuf, vis); |
3394 | iRangei invalidRange[3]; | 3393 | iRangei invalidRange[iElemCount(d->visBuf->buffers)]; |
3395 | invalidRanges_VisBuf(visBuf, full, invalidRange); | 3394 | invalidRanges_VisBuf(visBuf, full, invalidRange); |
3396 | /* Redraw the invalid ranges. */ { | 3395 | /* Redraw the invalid ranges. */ { |
3397 | iPaint *p = &ctx.paint; | 3396 | iPaint *p = &ctx.paint; |