-
-
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(BaseBrush): clipPath
#7175
base: master
Are you sure you want to change the base?
Conversation
renamed `render` to `renderChuck` `render` method now renders all the spray to align with all the brushes
expose `_addClipPathToResult` If there's a clip path set on the brush it is applied to the brush result
To align with this PR
i do not think we should do that. We should work toward having a clear order of operation there and adding the clipPath there if necessary. |
Did you try the demo? |
Thinking again it can't happen. Because once |
Isn't canvas clip path applied to all of it? That is not the use case described or the motivation of this PR |
I think this is a cool feature. |
@ShaMan123 this is a cool feature, yes.
brush themselves need to be changed in something that is more similar to custom controls, one class and callbacks for your own rendering. |
@asturur what about this? |
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.
Updated from master.
Suitable for v6.
Eraser supported (needs group PRs to merge into master to function properly)
Something is off with Eraser. I don't know if it's eraser or the clip path.
Need to check deeper.
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.
Ready to merge!
This reverts whitespace commited by 3f0f328.
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.
Fixed absolutePositioned
Build fails because of async
usage.
Visual tests fail but after examining myself I don't see any visual difference.
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.
Updated from master, resolved conflicts and tested
Overview
This PR adds a
clipPath
property to all brushes, aligning them withfabric.Object
.It BREAKS
SprayBrush
, it can be avoided with different naming if necessary.Motivation
closes #7134
closes #6955
closes #5431
Demo
https://codesandbox.io/s/upbeat-microservice-mkbzs?file=/src/App.tsxLogic
clipPath
property toBaseBrush
and exposed clip path methodsrender
+_render
method onBaseBrush
which conforms to Object#render and is in charge of:_render
which is implemented by each brush_render
instead of_render
- BREAKINGSprayBrush
to make it compatible with all brushes (renamed it's previousrender
method torenderChunck
), renamedEraserBrush
render
method torenderAll
To Do
Watch
Pay no attention to eraser bug. It's fixed by the group PRs.
With Eraser patched up
absolutePositioned
+ viewportTransform