-
-
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(Layer): Group Rewrite #7449
Conversation
Check out the POC!! |
Looks great! exactly what we were asking if can be done a while ago, thank you @ShaMan123 ! Do you have an ETA for all the to dos? any way we can help? P.s. My name is Elad and would really love to chat with you when you have the time [email protected] |
Looks like a very good feature. |
@ebigtm I messaged you. Regarding ETA. This PR is almost done. Another issue that needs to be decided is if Layer will in fact deprecate Group. Another thoughtThe matrix diff takes place in ContributingLet's! Choose a to do from the to do list and go for it. I can help you getting started. I think creating/migrating tests is the right place to start. I would simply copy all relevant tests from group and add additional tests for Layer specifics (the matrix diff approach) and tests covering all issues that this PR aims to solve (see PR description). And of course docs and a demo. |
updated comments |
In my opinion, regarding the way objects should be chosen, as far as I know there are two major ways that should both be possible:
The regular behaviour should be group selection (with bounding boz of the whole group). however I would leave it to be decided later by whoever uses it since each case can be different, so I would not hard-code this behaviour Regarding the contribution, sounds great! P.s. I tried to put an absolute positioned clippath and it produces some weird glitches in the left and top edges when moving individual objects. When trying to add relative position clippath it didn't even render the changes for some reason. |
I am not sure how caching behaves. Clip path is rendered using the cache
canvas. Compare group to layer to better understand. I'll have time later
to look at it.
בתאריך יום ב׳, 25 באוק׳ 2021, 10:28, מאת ebigtm ***@***.***>:
… In my opinion, regarding the way objects should be chosen, as far as I
know there are two major ways that should both be possible:
1. Select the objects inside using a double click on the parent.
2. Select the objects inside using a modifier key (usually alt).
The regular behaviour should be group selection (with bounding boz of the
whole group).
*however I would leave it to be decided later by whoever uses it since
each case can be different, so I would not hard-code this behaviour*
Regarding the contribution, sounds great!
P.s. I tried to put an absolute positioned clippath and it produces some
weird glitches in the left and top edges when moving individual objects.
https://wj37y.csb.app/
When trying to add relative position clippath it didn't even render the
changes for some reason.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7449 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIGAW4OT75DSC4RBO5WQ75TUIUBKHANCNFSM5GSQP6RQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Just seen this, i ll try to read it all tomorrow.
If you know where in the 5 linked issues those informations are, please direct me. |
I will also start with some specific questions:
Can layers be part of groups? Can layers nest insider other layers? Please try to define how a Layer is supposed to behave so that i can read code in that context |
Groups are not going away. |
The latest commits fixed object stacking when selecting. Of course this needs to be tested with n>2 levels of nesting. |
active selection tests need adjusting |
selecting an object belonging to the same parent while under a foreign object.
Anyone interested in trying this out: |
closed by #7473 |
Motivation
#7316 #6776 #7136 #7299 #7130 #7142 #2073
Group is obsolete. We need something much better for fabric.
I think this is a successful predecessor that can replace Group entirely.
Gist
I managed to come up with this solution thanks to this fabricjs/fabricjs.com#315:
This is why Layer objects are transformed relative to canvas
Impl
calcOwnMatrix
. The method adds the transform diff from the previous call to objects.To Do
getLayoutStrategyResult
, need to support rotation)