Re: [svgwg] Rect decomposition is invalid (#753)

> Any changed behavior in SVG 2 must be justified either as an obvious bug fix, clarification of inconsistent behavior between major user agents, or a removal of a rarely used, unimplemented, or poorly implemented feature.

I see. Well, this makes the discussion much simpler for many of the things we discussed the past few weeks.

Assuming that for basic shapes, markers are defined from their equivalent path (not treated as a special case), and using `<rect x="10" y="10" width="20", height="20" />` as an example, here are some equivalent paths we could consider, trying to be exhaustive:

```
Option A1: most concise and satisfying theoretically
4 vertices, 4 edges
1 marker-start, 3 marker-mids, 1 marker-end

M 10 10
H 30
V 30
H 10
Z

Option A2: adding 5th vertex + zero-length 5th edge
5 vertices, 5 edges
1 marker-start, 4 marker-mids, 1 marker-end

M 10 10
H 30
V 30
H 10
V 10
Z

Option B1: same as A1 but with zero-length arcs, with segment-completing closepath (SCZ)
Zero-length arcs allows for flicker-free animation of rx/ry with semi-transparent markers
8 vertices, 8 edges
1 marker-start, 7 marker-mids, 1 marker-end

M 10 10
H 30
A 0 0 0 0 1 30 10
V 30
A 0 0 0 0 1 30 30
H 10
A 0 0 0 0 1 10 30
V 10
A 0 0 0 0 1
Z

Option B2: same as B1 but without the SCZ
9 vertices, 9 edges
1 marker-start, 8 marker-mids, 1 marker-end

M 10 10
H 30
A 0 0 0 0 1 30 10
V 30
A 0 0 0 0 1 30 30
H 10
A 0 0 0 0 1 10 30
V 10
A 0 0 0 0 1 10 10
Z

Option C1: same as B1 but starting with an arc, ending with an (implicit) lineto.
Ending with a lineto rather than an arc allows for a non-zero Z without the need for SCZ
8 vertices, 8 edges
1 marker-start, 7 marker-mid, 1 marker-end

M 10 10
A 0 0 0 0 1 10 10
H 30
A 0 0 0 0 1 30 10
V 30
A 0 0 0 0 1 30 30
H 10
A 0 0 0 0 1 10 30
Z

Option C2: same as C1 but adding 9th vertex + zero-length 9th edge
9 vertices, 9 edges
1 marker-start, 8 marker-mids, 1 marker-end

M 10 10
A 0 0 0 0 1 10 10
H 30
A 0 0 0 0 1 30 10
V 30
A 0 0 0 0 1 30 30
H 10
A 0 0 0 0 1 10 30
V 10
Z
```

My choice would be A1. Option A2 plays "better" with marker-mids (4 of them), which is more intuitive for people unfamiliar with how markers behave with closed path, but seems to implicitly say "the standard recommends duplicating the start vertex even when using Z", which I don't think should be considered best practice (Or should it? In which case we'd better make that explicit, and it conflict with the behavior of Inkscape to automatically delete these redundant vertices). I added the B/C options just as food for thoughts: I don't think the advantage of avoiding animation flickers when rx/ry is animated is worth the added zero-length arcs in the more standard case.

-- 
GitHub Notification of comment by dalboris
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/753#issuecomment-561264401 using your GitHub account

Received on Tuesday, 3 December 2019 17:09:05 UTC