Skip to content

Commit

Permalink
Add stroke dash offset must be at end
Browse files Browse the repository at this point in the history
  • Loading branch information
b-wils committed Nov 27, 2024
1 parent 66e1f90 commit 691ddc3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
6 changes: 5 additions & 1 deletion docs/specs/shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,11 @@ 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]`.
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}

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 691ddc3

Please sign in to comment.