summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-20 09:49:05 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-20 09:49:05 +0300
commit3a439789b7f84675a84d13bd89b17c5e97f04961 (patch)
tree287692abd1c19b5d6bb0dded062f46e93cb7ed27 /src/ui
parent57cbcc6e864abd368bde93154b3580147936201c (diff)
DocumentWidget: Glitches with link hover
The invalid runs were sometimes discarded before they had a chance to be drawn.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/documentwidget.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 48ce5b5f..60580da6 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -658,6 +658,8 @@ static void invalidateWideRunsWithNonzeroOffset_DocumentWidget_(iDocumentWidget
658 } 658 }
659} 659}
660 660
661static void updateHover_DocumentWidget_(iDocumentWidget *d, iInt2 mouse);
662
661static void animate_DocumentWidget_(void *ticker) { 663static void animate_DocumentWidget_(void *ticker) {
662 iDocumentWidget *d = ticker; 664 iDocumentWidget *d = ticker;
663 refresh_Widget(d); 665 refresh_Widget(d);
@@ -1811,6 +1813,10 @@ static void refreshWhileScrolling_DocumentWidget_(iAny *ptr) {
1811 if (!isFinished_SmoothScroll(&d->scrollY) || !isFinished_Anim(&d->animWideRunOffset)) { 1813 if (!isFinished_SmoothScroll(&d->scrollY) || !isFinished_Anim(&d->animWideRunOffset)) {
1812 addTicker_App(refreshWhileScrolling_DocumentWidget_, d); 1814 addTicker_App(refreshWhileScrolling_DocumentWidget_, d);
1813 } 1815 }
1816 if (isFinished_SmoothScroll(&d->scrollY)) {
1817 iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iFalse);
1818 updateHover_DocumentWidget_(d, mouseCoord_Window(get_Window(), 0));
1819 }
1814} 1820}
1815 1821
1816static void scrollBegan_DocumentWidget_(iAnyObject *any, int offset, uint32_t duration) { 1822static void scrollBegan_DocumentWidget_(iAnyObject *any, int offset, uint32_t duration) {
@@ -4771,8 +4777,8 @@ static iBool render_DocumentWidget_(const iDocumentWidget *d, iDrawContext *ctx,
4771 iPaint *p = &ctx->paint; 4777 iPaint *p = &ctx->paint;
4772 init_Paint(p); 4778 init_Paint(p);
4773 iForIndices(i, visBuf->buffers) { 4779 iForIndices(i, visBuf->buffers) {
4774 iVisBufTexture *buf = &visBuf->buffers[i]; 4780 iVisBufTexture *buf = &visBuf->buffers[i];
4775 iVisBufMeta * meta = buf->user; 4781 iVisBufMeta *meta = buf->user;
4776 const iRangei bufRange = intersect_Rangei(bufferRange_VisBuf(visBuf, i), full); 4782 const iRangei bufRange = intersect_Rangei(bufferRange_VisBuf(visBuf, i), full);
4777 const iRangei bufVisRange = intersect_Rangei(bufRange, vis); 4783 const iRangei bufVisRange = intersect_Rangei(bufRange, vis);
4778 ctx->widgetBounds = moved_Rect(ctxWidgetBounds, init_I2(0, -buf->origin)); 4784 ctx->widgetBounds = moved_Rect(ctxWidgetBounds, init_I2(0, -buf->origin));
@@ -4906,7 +4912,9 @@ static iBool render_DocumentWidget_(const iDocumentWidget *d, iDrawContext *ctx,
4906 break; 4912 break;
4907 } 4913 }
4908 } 4914 }
4909 clear_PtrSet(d->invalidRuns); 4915 if (!prerenderExtra) {
4916 clear_PtrSet(d->invalidRuns);
4917 }
4910 } 4918 }
4911 return didDraw; 4919 return didDraw;
4912} 4920}