paperjs / paper.js

The Swiss Army Knife of Vector Graphics Scripting – Scriptographer ported to JavaScript and the browser, using HTML5 Canvas. Created by @lehni & @puckey
http://paperjs.org
Other
14.45k stars 1.22k forks source link

Cannot access view methods #424

Closed yleflour closed 10 years ago

yleflour commented 10 years ago

When using paperscript, play(), pause(), update() methods are not accessible from any view and are not listed if the view object is displayed in a debugging window. capture

lehni commented 10 years ago

Sounds like you're using an old version of the library? It works here:

http://sketch.paperjs.org/#S/q1bKS8xNVbJSCs5OLUnOUNJRSs5PAfGT8/OK83NS9XLy0zXKMlPL9QpyEis1rZVqAQ==

yleflour commented 10 years ago

Just tested under 0.9.16 (was running under 0.9.15 before) and I still have the same issue. It seems to come from manual project instanciation such as:

myProject = new Project("mainCanvas");
console.log(myProject.view.update);
lehni commented 10 years ago

It works for me, really strange. Could you provide a test case with the HTML and all? It can be a link to a zip file. Thanks!

yleflour commented 10 years ago

Okay, I was fiddling with my code and seem to have fixed the issue. I don't understand how or when it happened and I've been going through the git diffs for an hour trying to replicate the issue. It mostly seems that the issue came from fabric 0.9.15 (cannot locate where). The issue should probably be closed as part of the fix involved switching version.

Sorry for having made you lose your time.

Edit: replicated the issue here: https://c9.io/yleflour_1/paper-demos/workspace/viewError/index.html src: https://c9.io/yleflour_1/paper-demos# (viewError)

It seems to come from adding a project when the first one is based on the global view in 0.9.15 only.