zengm-games / facesjs

A JavaScript library for generating vector-based cartoon faces
https://zengm.com/facesjs/
Apache License 2.0
1.29k stars 99 forks source link

Glitch from Reddit #45

Closed tomkennedy22 closed 6 months ago

tomkennedy22 commented 6 months ago

"Terrifying glitch" from reddit sub

image

@dumbmatter had a good synopsis of issue:

How to trigger this glitch:

  1. Play up until the All-Star game
  2. Make your window really narrow, like as narrow as a cell phone
  3. Go to the Slam Dunk or Three-Point Contest page
  4. Make your window wider again

The reason is that if the window is small, then it doesn't show the faces of those players. But it does draw them, it just doesn't show them. The problem is that if a face is drawn while it's not displayed, then some of the facial features get messed up, because some of them are positioned relatively to others but that only works if it's actually shown.

After writing that, idk if that will makes sense to anyone :) but the fix would be to delay drawing the face until it's actually displayed.


Would the lazy loading functionality from Face component solve this?

dumbmatter commented 6 months ago

Would the lazy loading functionality from Face component solve this?

I think so. It might make sense to expose that from the facesjs package. I will probably take a look at that at some point.

dumbmatter commented 6 months ago

"at some point" was very soon, so this is now fixed in version 4.2.0 :)