Skip to content

Commit

Permalink
editor: nine-slicing core data type definitions
Browse files Browse the repository at this point in the history
This PR adds the core data types to support n-slicing. There are three main types: Axis, NSlicer and NSlicerTileMode.
1. Axis: I didn't want to make this super specific, since it could be used for grids later. So rn, it just represents some position in some dimension, and can either be a value in terms of a positional unit (like 10px) or bounds percentage (like 10%).
2. NSlicer: It's as simple as a component gets, we'll just use it to be a parent of all the n-slicer Axes, and have it be a child of Image later.
3. NSlicerTileMode: The main data here is 'style'. We said to use patchX and patchY separately from patchIndex. The last one is persisted in file, while the other two are actually used at runtime.

The non-json files are auto generated, with the runtime json files copy pasted from the dev/defs version. I verified that the editor still runs, and the runtime also runs without error.

Next up, I'll use these definitions to change editor behavior.

Documentation: https://www.notion.so/rive-app/9-Slice-Tech-Proposal-Image-only-50b25ea8e79c4efabb681110e288f064#15f3a49ce3534baeafc31c37fb30cc0b

For a rough direction of how to implement nine-slicing, check out this research branch: https://github.com/rive-app/rive/compare/master...susan/nine-slice-research

Diffs=
ed56d2de6 editor: nine-slicing core data type definitions (#7840)
  • Loading branch information
susan101566 committed Aug 14, 2024
1 parent a5d3046 commit a7a7cb5
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 @@
7a55a6db37d221b365fa29a82e60781265ba1c47
ed56d2de61afb05abd99e8bab6775b63ab89f1a3
2 changes: 1 addition & 1 deletion .rive_renderer
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b2b96743b9cc368c07521e0c19c2c587d1ef4873
8a3627f0b5872bff336c3c2b22fdb4e726bfefc3
2 changes: 1 addition & 1 deletion submodules/rive-cpp

0 comments on commit a7a7cb5

Please sign in to comment.