CreateJS / EaselJS

The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with the HTML5 Canvas element much easier.
http://createjs.com/
MIT License
8.13k stars 1.97k forks source link

cache method fails in NEXT version installed with NPM #1004

Open DavidCasillasRivero opened 5 years ago

DavidCasillasRivero commented 5 years ago

TODO

Bug

Yes, only one topic found with the error too much recursion but seems unrelated unrelated.

Yes the problem happens in the last version.

Issue Details

The problem happens in the NEXT version of the library downloaded with npm.

"@createjs/easeljs": "^2.0.0-beta.4" Using dist/easel-NEXT.js file.

The problem is not happening in non NEXT versions.

The problem is not happening in NEXT version downloaded directly from current master branch (1.0.2).

The method Shape.cache gives an too much recursion error.

You can test in your own Painting demo, adding a cache instruction to the drawingCanvas object:

drawingCanvas.cache(0, 0, 600, 600); 
createCanvas https://localhost:3000/easeljs-NEXT.js:2558:4
createCanvas https://localhost:3000/easeljs-NEXT.js:2566:10
createCanvas https://localhost:3000/easeljs-NEXT.js:2566:10
createCanvas https://localhost:3000/easeljs-NEXT.js:2566:10
createCanvas https://localhost:3000/easeljs-NEXT.js:2566:10
...
...

I have created a Code pen with the library downloaded with npm and the code in your demo, adding the code below. If you open developer tools you can see the error. Removing the code fixes the issue:

This is line 6325 in js:

// BUG
drawingCanvas.cache(0, 0, 100, 100);  

Use a library non downloaded from npm.