From 88f5f09f961e85733d48bbf8f0b4adc3be656f54 Mon Sep 17 00:00:00 2001 From: susan101566 Date: Fri, 1 Nov 2024 18:02:32 +0000 Subject: [PATCH] runtime: add support for gradients in vector n-slicer 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) --- .rive_head | 2 +- submodules/rive-runtime | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rive_head b/.rive_head index 777c4544..9b3062b4 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -5a4418dba6e76c82526fdc1cd832d580bdb66daf +91d092f4fc0c536e65dcfc513252d7f2b159ec77 diff --git a/submodules/rive-runtime b/submodules/rive-runtime index 1057ab59..c3be5464 160000 --- a/submodules/rive-runtime +++ b/submodules/rive-runtime @@ -1 +1 @@ -Subproject commit 1057ab590cd611afdcfed2745f5ae2df62d0dc7f +Subproject commit c3be5464307ad8789f0b4356d4a1013433848133