-
-
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(text.class.js) add path rendering to textpaths #7328
Conversation
src/shapes/text.class.js
Outdated
@@ -498,6 +498,7 @@ | |||
* @param {CanvasRenderingContext2D} ctx Context to render on | |||
*/ | |||
_render: function(ctx) { | |||
this.path && this.path._render(ctx); |
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.
mmmm
let me understand this.
So if i don't want to draw a path, what do i do?
i have to set strokeWidth or stroke empty or fill empty?
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.
That's my thinking yes. Currently though there's no check for the visible
property, so maybe I should add that as one more way to hide the path?
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.
good idea. visible is checked somewhere else higher up in the rendering chain, but yes adding that here is ok. and opacity > 0.
i'm not opposed to this, it sounds strange initially, but if i stop thinking isn't bad. |
We have e method called .isNotVisible that takes in account opacity and isVisible and some other little stuff. |
Code Coverage Summary
|
i did not make a good choice with tests. |
Code Coverage Summary
|
Ok path opacity does not work, just a note does not have to be a bug. |
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
Hi @asturur if I enliven a IText with a path, I get the following error Maybe there's a check missing or when re-building the IText the Path isn't being recreated? |
Can you reproduce it in a fiddle? |
https://user-images.githubusercontent.com/9057412/130850444-8856caad-29ae-43f5-af3f-857b6fd82973.gif @melchiar Would you be so kind as to share the fiddle for the above example you posted? I've checked here http://jsfiddle.net/user/melchiar/fiddles/ but don't see it. Thank you! |
@digitalml Sure, I actually shared it in the main text on path issue tracker as well #6543 (comment) |
@melchiar thank you. I did see this one. I was specifically looking for the hidden path version. |
I haven't made a demo of that code since it's part of our platform, but it's just a matter of using events to show/hide the path during and after performing transformations. |
Hi @eltaiguer . I have the same problem - |
@shyko the path property is in beta and isn't currently supported for iText objects (just Text objects for now) |
@melchiar Hi, is it possible to have a Fiddle of the demo from the 25/08 ? The interaction is exactly what I need... Thanks |
Thank for this @melchiar! this is what worked for me. jsfiddle is not working, but I just copied code in my project and works perfectly. |
This adds path rendering for text objects that contain a path.
@asturur - let me know if you're okay with this implementation and I'll add a visual test.