Paper.js: Path stroking regression with opacity

Created on 26 May 2016  路  4Comments  路  Source: paperjs/paper.js

Commit 948a8af9a84448e837 (checked with git bisect) is causing a strange regression in my project:
When opacity is applied to some stroked and filled paths, the path stroke goes off to infinite.

I haven't managed to isolate a simple test case. The paths are computed at runtime and re-creating the same through strokeData does not appear to work. The strokeData version is also terribly jagged compared to the smooth actual path. The actual path uses a round strokeJoin.

Example:
pathregression

The only change between the arrowhead on the left and the arrowhead on the right is that a 0.5 opacity applied to the right in the constructor. Commits prior to 948a8af9a8 render both versions fine.

I'll still try to create a test case, but wanted to see if anyone has experienced similar.

path-processing bug

Most helpful comment

Sorry for lack of test case.

Commit 6ca3bb1c639: "Prevent Path#getStrokeBounds() from accidentally modifying segments" appears to have fixed this problem. Thanks!

All 4 comments

Do you mean pathData? The reason why you can't recreate is because pathData rounds to a certain precision. You should be able to get around that by using a higher precision and calling the hidden: path.getPathData(null, 16). Could you try that?

Any chance of getting a test case using the increased precision?

@tjunnone asking you again to submit some more data. Without it, I will have to close this issue.

Sorry for lack of test case.

Commit 6ca3bb1c639: "Prevent Path#getStrokeBounds() from accidentally modifying segments" appears to have fixed this problem. Thanks!

Was this page helpful?
0 / 5 - 0 ratings