diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-07 12:52:30 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-07 12:52:30 +0300 |
commit | 00d45b6633aecf37b758bd55947b90c4cf3669b3 (patch) | |
tree | 581a2d24ade291b98632c9ab681c87846a3bc872 | |
parent | 1ffd161fa550d5334df7ee1aaa16bc369a1324b4 (diff) |
Fixed constant window redrawing
There were a couple of uninitialized values, which meant that the hovering outline was sometimes interpreted to be in an indefinite animation.
-rw-r--r-- | src/ui/documentwidget.c | 1 | ||||
-rw-r--r-- | src/ui/window.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 27a26d99..8e63dcee 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -233,6 +233,7 @@ void init_DocumentWidget(iDocumentWidget *d) { | |||
233 | d->invalidRuns = new_PtrSet(); | 233 | d->invalidRuns = new_PtrSet(); |
234 | init_Array(&d->outline, sizeof(iOutlineItem)); | 234 | init_Array(&d->outline, sizeof(iOutlineItem)); |
235 | init_Anim(&d->sideOpacity, 0); | 235 | init_Anim(&d->sideOpacity, 0); |
236 | init_Anim(&d->outlineOpacity, 0); | ||
236 | init_String(&d->sourceMime); | 237 | init_String(&d->sourceMime); |
237 | init_Block(&d->sourceContent, 0); | 238 | init_Block(&d->sourceContent, 0); |
238 | init_PtrArray(&d->visibleLinks); | 239 | init_PtrArray(&d->visibleLinks); |
diff --git a/src/ui/window.c b/src/ui/window.c index aac2405c..b90b2b55 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -589,6 +589,7 @@ void init_Window(iWindow *d, iRect rect) { | |||
589 | #endif | 589 | #endif |
590 | d->root = new_Widget(); | 590 | d->root = new_Widget(); |
591 | d->presentTime = 0.0; | 591 | d->presentTime = 0.0; |
592 | d->frameTime = SDL_GetTicks(); | ||
592 | setId_Widget(d->root, "root"); | 593 | setId_Widget(d->root, "root"); |
593 | init_Text(d->render); | 594 | init_Text(d->render); |
594 | setupUserInterface_Window(d); | 595 | setupUserInterface_Window(d); |
@@ -725,6 +726,9 @@ void draw_Window(iWindow *d) { | |||
725 | if (d->isDrawFrozen) { | 726 | if (d->isDrawFrozen) { |
726 | return; | 727 | return; |
727 | } | 728 | } |
729 | //#if !defined (NDEBUG) | ||
730 | // printf("draw %d\n", d->frameTime); fflush(stdout); | ||
731 | //#endif | ||
728 | /* Clear the window. */ | 732 | /* Clear the window. */ |
729 | SDL_SetRenderDrawColor(d->render, 0, 0, 0, 255); | 733 | SDL_SetRenderDrawColor(d->render, 0, 0, 0, 255); |
730 | SDL_RenderClear(d->render); | 734 | SDL_RenderClear(d->render); |