Skip to content

[Synfig Studio] Minor cleanup on LayerTree - #1979

Merged
ice0 merged 3 commits into
synfig:masterfrom
rodolforg:studio-simplify-layer-tree-1
Mar 3, 2021
Merged

ice0 merged 3 commits into
synfig:masterfrom
rodolforg:studio-simplify-layer-tree-1

Conversation

@rodolforg

@rodolforg rodolforg commented Jan 12, 2021 •

Copy link
Copy Markdown
Contributor

LayerTree is a fake widget. Its goal is to provide the (real) layer and parameter TreeViews. It isn't supposed to add it to any dialog or container. However, it contains deprecated and unused widgets from the time it was a real "widget".

I removed its unused/invisible/useless inner widgets and their signal handling. It speeds up a lot the layer movements by drag'n drop. For example, studio::LayerTree::on_blend_method_changed() was called at least 24 times while dragging a layer row in the Layer Panel.

After that, I saw on_dirty_preview() was empty and it wouldn't make sense to update neither Layer nor Parameter Panels if CanvasInterface emits this signal: LayerTreeStore already monitors layer changes (adding/removing/raising/lowering/…) Therefore, I removed on_dirty_preview() too.

Finally, quick_layer was a variable only used in the on_dirty_preview(), but, as everything there, it was commented out. So I deleted it too.

We can clean it up more: split into a real LayerTree and an isolated (ie, in other file) ParamTree. But I thought it would a big change to backport it to 1.4.1 if I did more.

This PR was inspired by Jose-Moreno comments in #540 (comment) and speeds up layer drag'n drop.

@rodolforg

rodolforg commented Jan 12, 2021 •

Copy link
Copy Markdown
Contributor Author

Of course, it could/should be squashed before merge.
I stopped here for better/easier review and backporting to 1.4.1

@rodolforg

Copy link
Copy Markdown
Contributor Author

Maybe it helps #525 too

@rodolforg rodolforg changed the title [Synfig Studio] Simplify LayerTree [Synfig Studio] Minor cleanup on LayerTree Jan 16, 2021
@rodolforg
rodolforg force-pushed the studio-simplify-layer-tree-1 branch from 177db01 to 4951d7f Compare January 19, 2021 03:40
Comment thread synfig-studio/src/gui/trees/layertree.h Resolved
@rodolforg

Copy link
Copy Markdown
Contributor Author

To be clear: this PR solves the problem mentioned by @Jose-Moreno here: https://youtu.be/A3D3mSo3ff0?t=579

@ice0

ice0 commented Feb 22, 2021

Copy link
Copy Markdown
Collaborator

To be clear: this PR solves the problem mentioned by @Jose-Moreno here: https://youtu.be/A3D3mSo3ff0?t=579

@rodolforg Does it solve it or just hides because of faster speed?

I tried to reproduce the problem using @Jose-Moreno captured mouse clicks and was able to reproduce it with the stable 1.4.0 version. Unfortunately when I build debug version I cannot reproduce the problem because I have a different GTK version on my local machine, and the GUI is slightly different so script just clicks on wrong places.

P.S. I assume that Synfig crashes when some exception occurred inside signal handler.

@rodolforg

Copy link
Copy Markdown
Contributor Author

I didn't say it solves the crash ;)

At that specific time on the video, he pointed the strange delay when we move a layer up/down.

That's what I fixed.

@ice0

ice0 commented Feb 22, 2021 •

Copy link
Copy Markdown
Collaborator

I didn't say it solves the crash ;)

Ok. I want to ask @Jose-Moreno for help again. After that I will merge this PR.

@Jose-Moreno

Copy link
Copy Markdown

@ice0 @rodolforg Hey. I've been reading your messages today. I'll gladly test Synfig once you review the other issue and merge any patches. 💪

Regarding this PR I'll test it as well later on when a dev build has been made as I can't currently spare time to setup the compilation environment required for Synfig 😅

@rodolforg

Copy link
Copy Markdown
Contributor Author

Regarding this PR I'll test it as well later on when a dev build has been made

Hey @Jose-Moreno ! you can test any PR on Windows. Just follow the steps described here: https://synfig.readthedocs.io/en/latest/how_to_help/testing_prs.html

IIRC you'll need the release package extracted in a folder, and overwrite it.

@ice0

ice0 commented Feb 23, 2021

Copy link
Copy Markdown
Collaborator

as I can't currently spare time to setup the compilation environment required for Synfig

I will prepare all the necessary binaries for you :)

@ice0
ice0 merged commit c2371f7 into synfig:master Mar 3, 2021
@ice0

ice0 commented Mar 3, 2021

Copy link
Copy Markdown
Collaborator

Merged. Thank you!

@rodolforg rodolforg mentioned this pull request Apr 16, 2021
rodolforg added a commit to rodolforg/synfig that referenced this pull request Apr 17, 2021
rodolforg added a commit to rodolforg/synfig that referenced this pull request Apr 21, 2021
rodolforg added a commit to rodolforg/synfig that referenced this pull request Apr 26, 2021
rodolforg added a commit to rodolforg/synfig that referenced this pull request May 15, 2021
rodolforg added a commit to rodolforg/synfig that referenced this pull request May 26, 2021
rodolforg added a commit to rodolforg/synfig that referenced this pull request May 27, 2021
morevnaproject pushed a commit to morevnaproject/synfig that referenced this pull request Aug 9, 2021
morevnaproject pushed a commit to morevnaproject/synfig that referenced this pull request Aug 9, 2021
@rodolforg
rodolforg deleted the studio-simplify-layer-tree-1 branch November 2, 2021 12:47
@rodolforg rodolforg removed the Backport label Feb 2, 2024
@rodolforg rodolforg added this to the v1.4.2 milestone 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.

3 participants