Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.25 regression: TypeError in PathItem.add #815

Closed
tjunnone opened this issue Oct 28, 2015 · 1 comment
Closed

0.9.25 regression: TypeError in PathItem.add #815

tjunnone opened this issue Oct 28, 2015 · 1 comment

Comments

@tjunnone
Copy link
Contributor

In my app, I have a paper.Path.Line item, and when dragging the item with the mouse I perform the following type of operation:

item.removeSegments();
item.add(new Point(100, 20), new Point(170, 75));

After I add and remove (removing items from the view seems to be key, it always starts after a removal) a number of these items to the view, I consistently receive the following exceptions when using Paper 0.9.25:
Uncaught TypeError: Cannot set property '_path' of undefined
PathItem.extend._adjustCurves @ paper-full.js:7336
PathItem.extend._add @ paper-full.js:7324
PathItem.extend.add @ paper-full.js:7359
<my code, doing the the item.add>

The line on paper-full.js:7336 is "curve._path = this;"

Now, I might be doing something wrong in my app, but downgrading to Paper 0.9.24 consistently fixes the issue, and I've tested moving between the two versions several times now.

There's a also a second type of error, where just clicking on the item that no longer can be moved due to the error above also produces a "Uncaught TypeError: Cannot read property 'getNormal' of null" in PathItem.extend.statics._addSquareCap @ paper-full.js:8540, happens inside of Paper's own PaperScopeItem.extend.hitTest in response to my code just printing out event.item.

@tjunnone
Copy link
Contributor Author

Git bisect between 0.9.24 and 0.9.25 suggests the breaking change is in the following commit:

commit 648985f
Author: Jürg Lehni juerg@scratchdisk.com
Date: Sat Oct 24 18:11:30 2015 +0200

Fix yet another issue with Path#curves and Path#_add()

Including a unit test to prevent regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant