Skip to content

Commit

Permalink
clone metrics path when a path is added
Browse files Browse the repository at this point in the history
When multiple strokes are added to the same path with trim path applied to them, and some are affected by transform, and some aren't, there's contention between the localPath and worldPath metrics.
This PR solves it by storing a unique metrics path per instance added. It copies the values from the original path so they aren't calculated more than needed.
There was the same contention with follow paths and trim paths, and it was solved in a slightly similar way, but there might be ramifications I'm missing from this approach.
NOTE: it also addresses this [TODO](https://github.com/rive-app/rive/blob/master/packages/runtime/src/shapes/metrics_path.cpp#L72), which ended up not being needed for this fix but left it since there was a TODO for it. I can remove it if it makes things more clear.

Diffs=
b58df4ba7 clone metrics path when a path is added (#6394)
  • Loading branch information
bodymovin committed Jan 4, 2024
1 parent 067f2c1 commit ebaf00d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
124a8f4e23baa003af40515d04686e2960cc5809
b58df4ba70205b17dbe8f4e8204d0a78becabeaa
2 changes: 1 addition & 1 deletion .rive_renderer
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c8929102837f2854d911ab6bfec90515e742fd37
94ac6cca5c63f9d91107821b07cc44151a2e803d
2 changes: 1 addition & 1 deletion submodules/rive-cpp

0 comments on commit ebaf00d

Please sign in to comment.