Skip to content

[Synfig Studio] Fix action LayerDuplicate with layers "duplicate" o.O - #1971

Merged
ice0 merged 7 commits into
synfig:masterfrom
rodolforg:fix-action-layer-duplicate
Feb 6, 2021
Merged

ice0 merged 7 commits into
synfig:masterfrom
rodolforg:fix-action-layer-duplicate

Conversation

@rodolforg

@rodolforg rodolforg commented Jan 5, 2021 •

Copy link
Copy Markdown
Contributor

Two problems fixed:

And it implements a test for LayerDuplicate action (in synfig-studio/testfolder). For Autotools, build and run it with make check ;)

@ghost

ghost commented Jan 5, 2021 •

Copy link
Copy Markdown

Congratulations 🎉. DeepCode analyzed your code in 4.037 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@rodolforg
rodolforg force-pushed the fix-action-layer-duplicate branch from 6c00d3d to bdbc986 Compare January 5, 2021 12:36
@rodolforg

Copy link
Copy Markdown
Contributor Author

And maybe this is the way to properly solve this #453

@rodolforg
rodolforg force-pushed the fix-action-layer-duplicate branch 4 times, most recently from b3c5efd to 667ae45 Compare January 14, 2021 22:47
@rodolforg
rodolforg marked this pull request as ready for review January 14, 2021 22:52
@rodolforg

rodolforg commented Jan 15, 2021 •

Copy link
Copy Markdown
Contributor Author

I think we should backport it.

By the way, the test file will fail at last test: it's the crash I reported recently #1983 This problem exists since 1.3.12

@rodolforg

Copy link
Copy Markdown
Contributor Author

@ice0 do you know why MacOS 11.0 action keeps failing?

@rodolforg rodolforg changed the title Fix action LayerDuplicate with layers "duplicate" o.O [Synfig Studio] Fix action LayerDuplicate with layers "duplicate" o.O Jan 16, 2021
@rodolforg

Copy link
Copy Markdown
Contributor Author

I just found out that the Paste (layer) command (available in LayerActionManager) code is almost a "copy'n-paste" of LayerDuplicate code. So we need to fix it there too. Or, even better, avoid this code duplication (oh my, so many 'duplicate' words)

@ice0

ice0 commented Jan 19, 2021

Copy link
Copy Markdown
Collaborator

@ice0 do you know why MacOS 11.0 action keeps failing?

Looks like GitHub problem: actions/runner-images#1814 (comment)

@ice0

ice0 commented Jan 19, 2021

Copy link
Copy Markdown
Collaborator

I just found out that the Paste (layer) command (available in LayerActionManager) code is almost a "copy'n-paste" of LayerDuplicate code. So we need to fix it there too. Or, even better, avoid this code duplication (oh my, so many 'duplicate' words)

Agree!

@ice0 ice0 added the Backport label Jan 19, 2021
@ice0
ice0 force-pushed the fix-action-layer-duplicate branch from 667ae45 to 63347b7 Compare January 19, 2021 03:38
ice0
ice0 previously approved these changes Jan 19, 2021
@rodolforg

Copy link
Copy Markdown
Contributor Author

Agree!

Ok, so I'll try to discover what could I do to avoid the duplication… lol
I thought about adding a new action parameter: "to-canvas"; if set, then it means it's a copy'n paste action, not a regular 'duplicate'.

@rodolforg

Copy link
Copy Markdown
Contributor Author

@ice0 in another PR or this one? (I still didn't start to work on this copy'n paste stuff)

@ice0

ice0 commented Jan 24, 2021

Copy link
Copy Markdown
Collaborator

@ice0 in another PR or this one? (I still didn't start to work on this copy'n paste stuff)

I think better to do it in another PR, so less changes need to be backported.

@ice0 ice0 added this to the v1.4.1 milestone Feb 4, 2021
The way it was: user was unable to add two Layer_Duplicate
without an error message and only the first layer Index would
be exported.
If user selected two layer_duplicate and activate
action Duplicate, an error would be raised: it would try
to export two valuenodes with same name.
instead of Index valuenode from original Layer_Duplicate.

fix synfig#1921
Consider this scene tree:
 - group A
   - layer_duplicate A
 - group B
   - layer_duplicate B

If user wants to duplicate both 'layer_duplicate A' and
'layer_duplicate B', but not the group, an error would raise.
@ice0
ice0 force-pushed the fix-action-layer-duplicate branch from 63347b7 to 697e50f Compare February 6, 2021 05:28
@ice0
ice0 merged commit d8e1837 into synfig:master Feb 6, 2021
@ice0

ice0 commented Feb 6, 2021

Copy link
Copy Markdown
Collaborator

Merged. Thank you!

@ice0 ice0 mentioned this pull request Feb 28, 2021
@rodolforg
rodolforg deleted the fix-action-layer-duplicate branch November 2, 2021 12:51
@rodolforg rodolforg removed the Backport label Feb 2, 2024
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