Skip to content

Commit

Permalink
runtime: add support for gradients in vector n-slicer
Browse files Browse the repository at this point in the history
This PR can be reviewed commit-by-commit. It mirrors the changes in the editor in https://github.com/rive-app/rive/pull/8413

Demo:
![aaaa](https://github.com/user-attachments/assets/1bf295a0-8bc2-442c-b15f-7214e53e3da8)
Note that the gradient moves with the node.

Some highlights:
1. I've introduced a nslicer dirt that's used to represent axes changing (instead of re-using dirt.path).
2. `updateMapWorldPoint` is a lambda function that caches what can be reused between consecutive vertex deforming calls e.g. on the same path, the NSlicer's axes stops don't change, so we don't need to calculate the inverse transform of the NSlicer when deforming every vertex.
3. There's a Deformer class that's the base of the point deformer and the render path deformer. The difference here is that in C++ I had to introduce an asComponent function to make it easy for a deformer to be cast between a RenderPathDeformer and a PointDeformer. I need to do this because the deformer on the shape has to be the same as the deformer on the gradient, so I need to cast the shape deformer to a render path deformer.

Diffs=
91d092f4fc runtime: add support for gradients in vector n-slicer (#8447)
  • Loading branch information
susan101566 committed Nov 1, 2024
1 parent 9f92d8e commit 88f5f09
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 @@
5a4418dba6e76c82526fdc1cd832d580bdb66daf
91d092f4fc0c536e65dcfc513252d7f2b159ec77

0 comments on commit 88f5f09

Please sign in to comment.