-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat(fabric.Path): Change the way path is parsed and drawn #6504
Conversation
var _join = Array.prototype.join; | ||
|
||
function segmentToBezier(th2, th3, cosTh, sinTh, rx, ry, cx1, cy1, mT, fromX, fromY) { | ||
var costh2 = fabric.util.cos(th2), |
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.
Hi, just for sure, this PR means the fabric.js will support Bezier Curve soon?
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.
What do you mean? fabric always drawn beizer curves but does not give you the ability to interact and modify them.
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.
Oh yes, I mean if this PR could give us ability to modify shapes with Becker Curves :DD hoping someone would create a sample 🎊
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.
This PR aims at removing everything that is not M L C Q from complex path. so that is easier to write code to handle paths manually.
So yes, it will help definitely with you text/path thing.
OK UT pass, but i first need a visual regression test PR to be merged on the current master. and run this gain |
]); | ||
x = current[6]; | ||
y = current[7]; | ||
break; |
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.
@melchiar i wrote code in the file util/path.js to handle 'a' and 'A' at parse time, and also all the lower case commands.
I would like to get rid in this function also of case 'T' and case 'S'. and keep 'C' and 'Q'.
An 'S' would become a paricular different 'C' and a 'T' a particular different 'Q'.
The drawing code in this function explains how. and the code should be added in util/path.js function makePathSimpler. The transtion from s to S and to t to T is already handled.
…path at parsing time (fabricjs#6504)
We want to simplify path code in order to make space for text on path ( curved text ) 🎉
First step of this work is to remove from the path:
all the non absolute commands, all the Arcs, and V and H.
Less command types will also mean less drawing and bounding box code.