-
Notifications
You must be signed in to change notification settings - Fork 59
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
WIP: paper.js integration #68
base: master
Are you sure you want to change the base?
Conversation
Nice, that approach seems to be fast and robust. |
if (!this.selectedSegment) return false; | ||
var pos = this.localize(evt.getPosition()), | ||
point = new paper.Point(pos.x, pos.y); | ||
point = point.subtract(this.getOrigin()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the path is rotated (through the normal Lively rotate), moving one point influences the positions of the others.
Maybe the problem can be found here somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we could apply the morphic transformations here to fix that behavior. However, I thought that it might be even better to change how rotation is done for paperjs morphs by using paperjs transformations and rotate the paperjs objects on the canvas itself... for simple usage of lines/curves the current behavior should be OK, though.
bezier handles: nice thing is they come for free as paperjs draws them when a paperjs item is marked "selected". Unfortunately their style is not yet customizable. |
This is super cool. I would like to use that for the SyncMorph in the Webwerkstatt. |
This is work in progress and the outcome of a weekend project.
paper.js is a HTML canvas JS library that supports
vector-style canvas rendering. Since our current path / polygon implementation
that is SVG-based suffers from the issues that arise when combining SVG /
HTML, this might be a a replacement.
Usage: