Skip to content
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

BREAKING(Object Stacking): 🔙 refactor logic to support Group 🔝 #8461

Merged
merged 52 commits into from
Dec 29, 2022

Conversation

ShaMan123
Copy link
Contributor

@ShaMan123 ShaMan123 commented Nov 23, 2022

Changes

  • Refactored logic to support object stacking operations on Group by moving relevant logic from StaticCanvas to Collection.
  • Refactored methods: canvas object stacking methods were renamed (sendToBack -> sendObjectToBack etc.)
  • BREAKING: removed object stacking mixin, stacking operation belong to the collection from now on. This makes it possible to act on any collection, including active selection (previously it was impossible to change the stacking order)
  • Removed active selection stacking tests since this PR solves the awkwardness the tests were testing.

ports & closes #7877

commit 7e7e6e7
Merge: 050ea1a d02fbf0
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Sun Nov 20 15:23:30 2022 +0200

    Merge branch 'master' into fix-transformer

commit 050ea1a
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Tue Nov 1 08:30:56 2022 +0200

    fix mixin parsing

commit 44eb941
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Tue Nov 1 07:45:16 2022 +0200

    Update index.mjs

commit 450e795
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 23:51:18 2022 +0200

    Update CHANGELOG.md

commit 9345400
Merge: 459e72f 2c0817b
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 23:49:25 2022 +0200

    Merge branch 'master' into fix-transformer

commit 459e72f
Merge: f9071cf 5d95075
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 23:33:32 2022 +0200

    Merge branch 'master' into fix-transformer

commit f9071cf
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 21:52:32 2022 +0200

    Update transform_files.mjs

commit 6ebf5ff
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 20:31:18 2022 +0200

    Update transform_files.mjs

commit 6433c0b
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 20:09:43 2022 +0200

    Update transform_files.mjs

commit 5793489
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 20:01:55 2022 +0200

    Update transform_files.mjs

commit 06a12b0
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 19:39:23 2022 +0200

    Update transform_files.mjs

commit 4111587
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 19:37:41 2022 +0200

    Create out.ts

commit a2f29c0
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:56:48 2022 +0200

    Update transform_files.mjs

commit 6587d19
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:49:32 2022 +0200

    Update transform_files.mjs

commit c3bf999
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:45:46 2022 +0200

    Update transform_files.mjs

commit 8105167
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:37:17 2022 +0200

    Update transform_files.mjs

commit b8de8aa
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:34:27 2022 +0200

    Update transform_files.mjs

commit 2d1d1da
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:22:47 2022 +0200

    Update transform_files.mjs

commit 781fe55
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:18:01 2022 +0200

    Update transform_files.mjs

commit daf443f
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 18:16:48 2022 +0200

    Update transform_files.mjs

commit 3c55455
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 17:41:30 2022 +0200

    Update transform_files.mjs

commit f567fcf
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 17:24:54 2022 +0200

    Update transform_files.mjs

commit 9ab2ea3
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 17:16:13 2022 +0200

    Update transform_files.mjs

commit b3c73d1
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 17:10:30 2022 +0200

    Update transform_files.mjs

commit f6d9031
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 16:51:10 2022 +0200

    Update transform_files.mjs

commit 6208499
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 15:51:00 2022 +0200

    Update transform_files.mjs

commit 483379a
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 13:38:10 2022 +0200

    static

commit 316ba1a
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 13:28:03 2022 +0200

    Update transform_files.mjs

commit bcb3124
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 12:00:43 2022 +0200

    Update transform_files.mjs

commit 1d555ad
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 11:53:37 2022 +0200

    Update transform_files.mjs

commit 5a04341
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 11:38:11 2022 +0200

    Update transform_files.mjs

commit 322c271
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 10:13:37 2022 +0200

    Update transform_files.mjs

commit 9b7f6f9
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 09:57:55 2022 +0200

    Update transform_files.mjs

commit e86aa95
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 08:32:27 2022 +0200

    Update transform_files.mjs

commit f23227f
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Oct 31 08:26:14 2022 +0200

    ast!
commit 7db65d0
Merge: 7a1820e 21003c7
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Jun 16 14:47:39 2022 +0300

    Merge branch 'master' into object-stacking-to-collection

commit 7a1820e
Merge: 642a487 d5107f5
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon Jun 13 09:21:43 2022 +0300

    Merge branch 'master' into object-stacking-to-collection

commit 642a487
Merge: 88205a7 b47814f
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Mon May 2 13:31:08 2022 +0300

    Merge branch 'master' into object-stacking-to-collection

commit 88205a7
Merge: 88fb82e 06de045
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Sun May 1 19:16:34 2022 +0300

    Merge branch 'master' into object-stacking-to-collection

commit 88fb82e
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Sun May 1 19:15:57 2022 +0300

    Update object_ancestry.mixin.js

commit 65efc2b
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 12:59:17 2022 +0300

    Update object_stacking.mixin.js

commit 0a151bf
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 12:59:12 2022 +0300

    port from patch7

    will probably cause merge conflict

commit 018ad2e
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 08:45:46 2022 +0300

    Update group.js

commit be4a257
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 08:40:56 2022 +0300

    Update object_stacking.mixin.js

commit d72398f
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 08:40:50 2022 +0300

    better checks

commit 1754f37
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 07:39:16 2022 +0300

    Update object_stacking.mixin.js

commit 08c917b
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 07:26:09 2022 +0300

    Update object_stacking.mixin.js

commit 9bdab30
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Fri Apr 15 07:23:57 2022 +0300

    renaming + `_getStackManager`

commit 593fd6f
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Apr 14 20:02:24 2022 +0300

    fix(): disable active selection imperative stack changes

commit 38aabae
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Apr 14 20:00:33 2022 +0300

    rename

commit 8437e8b
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Apr 14 19:53:34 2022 +0300

    remove callSuper - broken with Collection

    can't wait for proper typescript!!!!!

commit 799a1c3
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Apr 14 12:22:23 2022 +0300

    Update build.js

commit 55378a8
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Apr 14 12:21:57 2022 +0300

    Update collection.mixin.js

commit 4a487f8
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Apr 14 11:28:35 2022 +0300

    expose stack methods on group

commit f5a4f89
Author: ShaMan123 <shacharnen@gmail.com>
Date:   Thu Apr 14 10:43:22 2022 +0300

    chore(): move object stacking logic to collection
@github-actions
Copy link
Contributor

github-actions bot commented Nov 23, 2022

Build Stats

file / KB (diff) bundled minified
fabric 952.298 (-3.734) 304.427 (-1.370)

@ShaMan123 ShaMan123 mentioned this pull request Nov 23, 2022
48 tasks
@ShaMan123
Copy link
Contributor Author

ShaMan123 commented Nov 23, 2022

We need to decide the fate of ObjectStackingMixin... I think it should be removed.
If not we need to merge #8414 first.

@ShaMan123 ShaMan123 changed the title feat(Object Stacking): 🔙 refactor logic to support Group 🔝 fix(Object Stacking): 🔙 refactor logic to support Group 🔝 Nov 23, 2022
@ShaMan123 ShaMan123 requested a review from asturur November 27, 2022 18:18
@ShaMan123 ShaMan123 changed the title fix(Object Stacking): 🔙 refactor logic to support Group 🔝 BREAKING(Object Stacking): 🔙 refactor logic to support Group 🔝 Nov 29, 2022
Copy link
Contributor Author

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

READY

@@ -20,6 +21,11 @@ export function createCollectionMixin<T extends { new (...args: any[]): any }>(
// subclasses should override this method
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
_onStackOrderChanged(object: FabricObject) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can if we want send the indexes (from ,to) to this method. For now nothing uses it.
Perhaps for an event...

@@ -355,6 +355,14 @@ export class ObjectGeometry<
);
}

isOverlapping<T extends ObjectGeometry>(other: T): boolean {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exposed for ease of use

Copy link
Contributor Author

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@asturur
Copy link
Member

asturur commented Dec 29, 2022

Reding our notes this should be next

@asturur
Copy link
Member

asturur commented Dec 29, 2022

i'll review and merge today hopefully

@asturur
Copy link
Member

asturur commented Dec 29, 2022

Seems straight forward to me but need to take a break. This merging this PR will be my priority and then i ll try to make some different build index.js that is what i m most excited for right now.

@ShaMan123
Copy link
Contributor Author

Cool

@ShaMan123
Copy link
Contributor Author

Very exciting indeed

@asturur
Copy link
Member

asturur commented Dec 29, 2022

This is a great pr, love it.

@asturur asturur merged commit b7feb32 into master Dec 29, 2022
@ShaMan123
Copy link
Contributor Author

ShaMan123 commented Dec 29, 2022

This is a great pr, love it.

Love that you loved it 😍
I must try to nail it again (just today I found myself stopping and splitting a change since it grow out of scope...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants