editor: setting up the update callbacks for n-slicing I did some refactoring on image and mesh, where I created a 'deformer' that manages which mesh to show. I also abstracted out the parts in Mesh that deals with rendering specifically, called MeshDrawable. There's also a simple UI gated behind a feature flag that shows the N Slicing panel, where you can create, delete, update axis data (hold alt to show the remove axis button). The behavior is that when you create a mesh, the nslicer is deleted and vice versa. I mostly tested this manually. I added a print in the temp mesh's update, and made sure that when any axis gets deleted or updated, the print would trigger. I could add an auto test?! I need to look into that, but wanted to send this out to get some feedback on the approach. Next up: I'll add the algorithm for actually updating the render buffers in the temp mesh. doc: https://www.notion.so/rive-app/9-Slice-Tech-Proposal-Image-only-50b25ea8e79c4efabb681110e288f064#15f3a49ce3534baeafc31c37fb30cc0b Diffs= f99c93181 editor: setting up the update callbacks for n-slicing (#7869) Co-authored-by: Susan Wang <susan@rive.app>
diff --git a/.rive_head b/.rive_head index b68cbc7..7dcbdef 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -85343a4e1c287922f872d14172167af72b4c3358 +f99c93181b2073db07b0c54f766648ce56c89df9
diff --git a/dev/defs/layout/n_slicer.json b/dev/defs/layout/n_slicer.json index d642142..c244b37 100644 --- a/dev/defs/layout/n_slicer.json +++ b/dev/defs/layout/n_slicer.json
@@ -4,5 +4,5 @@ "int": 493, "string": "nslicer" }, - "extends": "component.json" + "extends": "container_component.json" } \ No newline at end of file
diff --git a/include/rive/generated/layout/n_slicer_base.hpp b/include/rive/generated/layout/n_slicer_base.hpp index 23fa548..9ef88e9 100644 --- a/include/rive/generated/layout/n_slicer_base.hpp +++ b/include/rive/generated/layout/n_slicer_base.hpp
@@ -1,12 +1,12 @@ #ifndef _RIVE_N_SLICER_BASE_HPP_ #define _RIVE_N_SLICER_BASE_HPP_ -#include "rive/component.hpp" +#include "rive/container_component.hpp" namespace rive { -class NSlicerBase : public Component +class NSlicerBase : public ContainerComponent { protected: - typedef Component Super; + typedef ContainerComponent Super; public: static const uint16_t typeKey = 493; @@ -18,6 +18,7 @@ switch (typeKey) { case NSlicerBase::typeKey: + case ContainerComponentBase::typeKey: case ComponentBase::typeKey: return true; default: