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 f01c44e commit 2b463b6
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 @@
4fb978a9230fc006b5e575364f062907e7dd2afe
ed56d2de61afb05abd99e8bab6775b63ab89f1a3
2 changes: 1 addition & 1 deletion wasm/submodules/rive-cpp

0 comments on commit 2b463b6

Please sign in to comment.