Skip to content

Commit

Permalink
editor: be more mindful of sending dirt recursively when n-slicing
Browse files Browse the repository at this point in the history
A long time ago, I only sent out dirt.nslicer when anything about the vector n-slicer changed. However, this caused clipping paths inside of a vector n-slicer to not update in time. I was worried to miss a spot, so in addition to sending dirt.nslicer, I also sent out dirt.path.. recursively...

Then it turns out that if there are texts inside of the n-sliced node, they will also listen to dirt.path, and that caused some performance issues. So now we are back to wanting to send dirt.nslicer, and have places that listen to it calculate things.

The way I audited this... I first did a search for all ComponentDirt.path in the Dart codebase:
![image](https://github.com/user-attachments/assets/281df80c-3320-46f2-9ff7-c3ee6e40065a)

Then for all of them, I see whether the check occurred in a update() function. If it does, then I added an dirt.nslicer condition too. This was after the first commit. I'm hoping that doing it this way means that the checks are complete, meaning I'm not missing any dirt.nslicer checks.

I then commented each out, and see whether something will not update in time. So e.g. if the update is on a layout node, I'd check whether a hug layout node responds to an nsliced node's width/height. (in this case, I don't need the nslicer check, so i removed it). This was the second commit. I'm hoping that doing it this way means all the dirt.nslicer checks are necessary.

Then the idea is...if we are doing sth complete and necessary, it's the right amount.

Diffs=
1d23ae5782 editor: be more mindful of sending dirt recursively when n-slicing (#8576)
  • Loading branch information
susan101566 committed Nov 16, 2024
1 parent 474b337 commit ae806d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cc15ffa4f66f77c61ffb549d0d371e711f5d001e
1d23ae578262f2d12b52f0bae387336a00626930
2 changes: 1 addition & 1 deletion submodules/rive-runtime

0 comments on commit ae806d3

Please sign in to comment.