jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.51k stars 745 forks source link

Weird graphical glitch #2993

Open gigamonkey opened 2 years ago

gigamonkey commented 2 years ago

Today working on an animation fairly frequently my Snap workspace would glitch out and suddenly the animation would start drawing in miniature in the middle of the screen. Window screen cap here:

image

When the mini me window comes in it doesn't just blit in as a rectangle but kind of draws in pieces, almost like it's drawing where the sprites are moving but within the miniature window.

In fact, if you look closely at the screen shot you can see places where the miniature window hasn't been fully drawn in.

gigamonkey commented 2 years ago

Here's the project. It doesn't happen all the time and I haven't been able to figure out how to cause it to happen.

https://snap.berkeley.edu/snap/snap.html#present:Username=gigamonkey&ProjectName=U5L2-Simulation

gigamonkey commented 2 years ago

Another screen shot

image

jmoenig commented 2 years ago

Hi, Peter, which browser are you using? I've seen this particular issue happen in recent versions of Firefox on MacOS, and haven't so far been able to find out exactly what the problem is. It seems to only happen in Firefox in the combination with recent MacOS releases when using many (offscreen) Canvas elements. Chromium/Chrome based browsers don't seem to have this problem, neither does Safari.

Generally I've found Firefox to be awesome, but recently browser and OS makers seem to have been breaking Canvas a lot (Google/Chrome far more frequently than Mozilla in my own experience). Usually they fix those issues within a couple of weeks, but this particular glitch has been going on in Firefox on MacOS for some months now. It seems to be linked to Snap projects using many "clones", which is using more Canvas instances, and my hunch is that something is simply running out of graphics resources wrt scaling Canvas contexts. My intermediate plan is to switch Snap over to the OffscreenCanvas API, but alas, Firefox isn't yet supporting any of that.

jguille2 commented 2 years ago

I only comment... that I can't reproduce this issue on Linux (neither Chromium nor Firefox)

gigamonkey commented 2 years ago

Yeah, I'm using Firefox on MacOS. And indeed this project is using many clones. I'll try Chrome and/or Safari then. Thanks.