mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🔧 Autogenerate serialization values for wasm enums (#7296)
* 🔧 Autogenerate serialization values for wasm enums * 🔧 Add serializer values to the wasm api * ✨ Avoid converting to a clojure map the serializer js object * 🔧 Update watch script for autoserialized enums * 🐛 Fix missing serializer values
This commit is contained in:
@@ -25,7 +25,7 @@ Horizontal constraints are serialized as `u8`:
|
||||
| ----- | --------- |
|
||||
| 0 | Left |
|
||||
| 1 | Right |
|
||||
| 2 | LeftRight |
|
||||
| 2 | Leftright |
|
||||
| 3 | Center |
|
||||
| 4 | Scale |
|
||||
| \_ | None |
|
||||
@@ -38,11 +38,22 @@ Vertical constraints are serialized as `u8`:
|
||||
| ----- | --------- |
|
||||
| 0 | Top |
|
||||
| 1 | Bottom |
|
||||
| 2 | TopBottom |
|
||||
| 2 | Topbottom |
|
||||
| 3 | Center |
|
||||
| 4 | Scale |
|
||||
| \_ | None |
|
||||
|
||||
## Vertical Alignment
|
||||
|
||||
Vertical alignment is serialized as `u8`:
|
||||
|
||||
| Value | Field |
|
||||
| ----- | ------ |
|
||||
| 0 | Top |
|
||||
| 1 | Center |
|
||||
| 2 | Bottom |
|
||||
| \_ | Top |
|
||||
|
||||
## Paths
|
||||
|
||||
Paths are made of segments of **28 bytes** each. The layout (assuming positions in a `Uint8Array`) is the following:
|
||||
@@ -126,16 +137,17 @@ Gradient stops are serialized as a sequence of `16` chunks with the following la
|
||||
|
||||
Stroke caps are serialized as `u8`:
|
||||
|
||||
| Value | Field |
|
||||
| ----- | --------- |
|
||||
| 1 | Line |
|
||||
| 2 | Triangle |
|
||||
| 3 | Rectangle |
|
||||
| 4 | Circle |
|
||||
| 5 | Diamond |
|
||||
| 6 | Round |
|
||||
| 7 | Square |
|
||||
| \_ | None |
|
||||
| Value | Field |
|
||||
| ----- | ------------- |
|
||||
| 0 | None |
|
||||
| 1 | LineArrow |
|
||||
| 2 | TriangleArrow |
|
||||
| 3 | SquareMarker |
|
||||
| 4 | CircleMarker |
|
||||
| 5 | DiamondMarker |
|
||||
| 6 | Round |
|
||||
| 7 | Square |
|
||||
| \_ | None |
|
||||
|
||||
## Stroke Sytles
|
||||
|
||||
|
||||
Reference in New Issue
Block a user