Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix redraw glitch where old time is shown #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

geftactics
Copy link

Clears time on each clock as window is hidden, and redraws when window show.

Prevents an issue where the previous time was briefly displayed, returning in a glitchy effect.

fixes #33

@tarutin
Copy link
Owner

tarutin commented Sep 22, 2024

@geftactics thanks! but why is this part needed?

function hideTime() {

     $all('.clock button').forEach(item => {
         let time = item.querySelector('time')
         time.innerText = ":"
     })
 }

@geftactics
Copy link
Author

When the app window is hidden, we remove the current time from the clocks with this function.

This prevents the old time from being shown for a few milliseconds next time the app window is opened, so a cleaner redraw experience.

@tarutin
Copy link
Owner

tarutin commented Sep 22, 2024

But with next tick all clocks in background recalculated from fn runClock()

@geftactics
Copy link
Author

geftactics commented Sep 22, 2024

Yes, but this doesn’t happen instantly… (it doesn’t look like tick happens when window is hidden?)

if I hide that app window at 22:49, then later open it at 23:00… I will see the 22:49 on screen for a split second before the tick happens and clocks are updated (you have to look hard for it, but it was bugging me each time I opened the app!)

This change just hides the old time to make this glitch less apparent when opening the window.

I could record a video and slow the speed down to show the issue if you are not seeing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Old times briefly displayed when opening window
2 participants