caleb531 / jcanvas

A jQuery plugin that makes the HTML5 canvas easy to work with.
https://projects.calebevans.me/jcanvas/
MIT License
626 stars 192 forks source link

layers not updated #22

Closed christophlsa closed 12 years ago

christophlsa commented 12 years ago

Hi,

When I use getLayer() and set an option (e.g. fillStyle) the layers are not updated until I move the mouse into the canvas. The same happens if I use setLayer().

When the layers already drawn and I use drawLayers() (to redraw the layers - I hope this is the right function) the following error was thrown:

eventCache is undefined

jcanvas.js (line 1677)

caleb531 commented 12 years ago

Setting a property with setLayer() is nto supposed to redraw the canvas afterwards. You should call .drawLayer() after performing all the necessary property changes.

Also, could you please provide the code you are using to reproduce the error?

-Caleb

On Wed, Jun 27, 2012 at 3:55 PM, Christoph Giesel < reply@reply.github.com

wrote:

Hi,

When I use getLayer() and set an option (e.g. fillStyle) the layers are not updated until I move the mouse into the canvas. The same happens if I use setLayer().

When the layers already drawn and I use drawLayers() (to redraw the layers

  • I hope this is the right function) the following error was thrown:

    eventCache is undefined

jcanvas.js (line 1677)


Reply to this email directly or view it on GitHub: https://github.com/caleb531/jcanvas/issues/22

christophlsa commented 12 years ago

Ah, this bug only occures if events like "mouseover" and "mouseout" are defined.

An example code: https://gist.github.com/3009886

If you remove these events this code works.

caleb531 commented 12 years ago

Okay, the bug is fixed in the latest jCanvas build, which I just pushed to GitHub.

Let me know how it works out. -Caleb

On Thu, Jun 28, 2012 at 1:33 AM, Christoph Giesel < reply@reply.github.com

wrote:

Ah, this bug only occures if events like "mouseover" and "mouseout" are defined.

An example code: https://gist.github.com/3009886

If you remove these events this code works.


Reply to this email directly or view it on GitHub: https://github.com/caleb531/jcanvas/issues/22#issuecomment-6624345

christophlsa commented 12 years ago

yeah, it works, ty ;)