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

SpriteSheetUtils working canvas cache #57

Closed
tommoor opened this issue Apr 22, 2011 · 4 comments
Closed

SpriteSheetUtils working canvas cache #57

tommoor opened this issue Apr 22, 2011 · 4 comments

Comments

@tommoor
Copy link

tommoor commented Apr 22, 2011

There is an issue with some sort of browser caching happening on the working canvas in SpriteSheetUtils, this has manifested itself as graphics from a SpriteSheet attached to one Bitmap Sequence appearing in another Bitmap Sequence.

I have fixed this in my particular instance by recreating the workingCanvas every time. I am not sure why this is fixing it - but it is! I am hoping to put together a reproducible testcase for this so that a better solution can be found as it has many hours of frustration here.

@tommoor
Copy link
Author

tommoor commented Apr 22, 2011

I have managed to recreate this issue by modifying one of the provided examples, what would be the best way for me to share this? - i need to include a couple of assets.

@davrous
Copy link

davrous commented Jul 22, 2011

Hi,

I've got the very same issue. If I'm removing the flip calls of SpriteSheetUtils, all my BitmapSequence display correctly. If I'm flipping, my 4 BitmapSequence have the very same sprite sequence as the last one (the forth one). Ever more weird: if I'm only adding 3 of my objects (instead of 4), there are displayed correctly every time... recreating the workingCanvas is indeed fixing the issue but this is not very memory/performance efficient.

I've tried to clear the canvas between each operation via :

this._workingContext.clearRect(0, 0, this._workingCanvas.width, this._workingCanvas.height);

But this doesn't help.

I've got also a repro sample ready if needed.

Regards,

David
http://blogs.msdn.com/davrous

@slimulus
Copy link

Hi guys/gals,

I have just started working with EaselJS in the last couple of days, and I encountered the same issue almost immediately. I was able to isolate the problem to SpriteSheetUtils.flip() as well. Because my project uses sprites with extremely limited color palettes, I have just opted to include the flipped sprites into the images from which my SpriteSheets are generated. The difference in file size is negligible, but it is sort of inconvenient and wouldn't be an acceptable workaround if I were using larger/more complicated sprite sets.

The issue does appear to be somehow related to browser caching, but I find that I can produce the incorrect sprite display (100% reproducible) only on the initial page load. After a refresh, I am unable to reproduce the issue on any subsequent page views.

For now, avoiding SpriteSheetUtils.flip() is an adequate workaround, but as the project grows, I would like to see this issue pinned down/resolved.

Thanks,
Sheldon

@gskinner
Copy link
Member

gskinner commented Aug 7, 2012

This should be fixed with the .addFlippedFrame() implementation in the current build.

@gskinner gskinner closed this as completed Aug 7, 2012
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

No branches or pull requests

4 participants