caleb531/jcanvas — pull request #15 by dksmiffs (2012-05-25 20:07:56+00:00)
Title: Queue a new jCanvas layer in a forced order

Caleb,

We had a conversation on Twitter back on 30 April regarding forcing a layer order in jCanvas. Your "load()" fn suggestion in that discussion seemed to only apply to "drawImage", which didn't meet my needs. So I have now successfully used callbacks in this commit and a new jCanvas method called "queueLayer" (which uses your new 24 May "addLayer" internal function).

A callback approach is a bit messier than (for instance) providing the end user a z-order parameter, but I'm not a good enough jCanvas wizard to try to tackle an approach like that ;-) I thought I'd share this code right away, I'll boil down example usage code and share it with you later if you're interested.

~ Dave (@dave_k_smith)