Skip to content

Commit

Permalink
Clarify stroke dash array ordering (#110)
Browse files Browse the repository at this point in the history
* Add pucker/bloat modifier

* Clarify stroke dash array ordering

* Revert "Add pucker/bloat modifier"

This reverts commit 4ff761c.

* Add stroke dash offset must be at end

---------

Co-authored-by: Mattia Basaglia <[email protected]>
  • Loading branch information
b-wils and mbasaglia authored Dec 3, 2024
1 parent 2f357f0 commit f472717
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__
node_modules
path
venv
.venv

# Operating system
.DS_Store
6 changes: 6 additions & 0 deletions docs/specs/shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,12 @@ come before them in [[stacking order]].

{schema_string:shapes/stroke-dash/description}

A stroke dash array consists of `n` dash entries, `[n-1,n]` gap entries and `[0-1]` offset entries.

Dash and gap entries MUST all be in a continuous order and alternate between dash and gap, starting with dash. If there are an odd number of dashes + gaps, the sequence will repeat with dashes and gaps reversed. For example a sequence of `[4d, 8g, 16d]` MUST be rendered as `[4d, 8g, 16d, 4g, 8d, 16g]`.

Offset entry, if present, MUST be at the end of the array.

{schema_object:shapes/stroke-dash}

<lottie-playground example="stroke.json">
Expand Down
10 changes: 5 additions & 5 deletions docs/static/examples/gradient-stroke.json
Original file line number Diff line number Diff line change
Expand Up @@ -1187,11 +1187,6 @@
"k": 30
},
"d": [
{
"n": "o",
"nm": "offset",
"v": {"a": 0, "k": 0}
},
{
"n": "d",
"nm": "dash",
Expand All @@ -1201,6 +1196,11 @@
"n": "g",
"nm": "gap",
"v": {"a": 0, "k": 0}
},
{
"n": "o",
"nm": "offset",
"v": {"a": 0, "k": 0}
}
],
"r": 1,
Expand Down
10 changes: 5 additions & 5 deletions docs/static/examples/stroke.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@
"k": 30
},
"d": [
{
"n": "o",
"nm": "offset",
"v": {"a": 0, "k": 0}
},
{
"n": "d",
"nm": "dash",
Expand All @@ -144,6 +139,11 @@
"n": "g",
"nm": "gap",
"v": {"a": 0, "k": 0}
},
{
"n": "o",
"nm": "offset",
"v": {"a": 0, "k": 0}
}
]
}
Expand Down

0 comments on commit f472717

Please sign in to comment.