ericdrowell / KineticJS

KineticJS is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://www.kineticjs.com
3.98k stars 752 forks source link

FastLayer and Stage resize #951

Closed rsgibson closed 10 years ago

rsgibson commented 10 years ago

I just updated from 5.0.0 to 5.1.0 and replaced one of my layers with a FastLayer. My stage width get sets after initialization with:

this.stage.size({ width: this.containers.color.currentColor.width(), height: this.containers.color.currentColor.height() });

I get an error from line 9312 "Uncaught TypeError: Cannot read property 'setSize' of undefined " by adding this if statement around that line it fixes the issue:

if(layer.hitCanvas){ layer.hitCanvas.setSize(width, height); }

Looking at the FastLayer prototype in console there is no hitCanvas property explaining the error.

lavrton commented 10 years ago

fixed. You may take latest version from from repo. kinetic.js or kinetic.min.js files.