Skip to content

Commit

Permalink
editor: setting up the update callbacks for n-slicing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
susan101566 and susan101566 committed Aug 19, 2024
1 parent 43d7f27 commit 215de97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
85343a4e1c287922f872d14172167af72b4c3358
f99c93181b2073db07b0c54f766648ce56c89df9
2 changes: 1 addition & 1 deletion dev/defs/layout/n_slicer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"int": 493,
"string": "nslicer"
},
"extends": "component.json"
"extends": "container_component.json"
}
7 changes: 4 additions & 3 deletions include/rive/generated/layout/n_slicer_base.hpp
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -18,6 +18,7 @@ class NSlicerBase : public Component
switch (typeKey)
{
case NSlicerBase::typeKey:
case ContainerComponentBase::typeKey:
case ComponentBase::typeKey:
return true;
default:
Expand Down

0 comments on commit 215de97

Please sign in to comment.