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

One possible conclusion is that since we're obviously not going to change the absence of mid-markers at the start/end of closed paths (as you said, this would be a substantial breaking change), then it might make it a compelling reason to *not use SCZ-ops in the path-definition of basic shapes*.

(SCZ-op = "segment-completing close operation")

This way, the following simple example:

```
<rect x="0" y="0" width="100" height="100" style="marker-mid: url(#markerCircle);"/>
```

Would behave symmetrically, with four markers, no special vertex.

On the other hand, we could also argue that:
- Not using SCZ-ops in the path-definition of basic shapes is inconsistent with adding SCZ-ops in the standard in the first place.
- Using SCZ-ops is actually conceptually cleaner.
- Having only 3 mid-markers for a `rect` element is actually more consistent with how mid-markers are defined, even though it might be a surprising behavior.

So **if** SCZ-ops do make it to the standard, then I would lean toward changing the path-definition of a rect to:

8. **If both rx and ry are greater than zero,** perform an absolute vertical lineto parameter y+ry. **Otherwise, perform a closepath operation.**
9. if both rx and ry are greater than zero, perform an absolute elliptical arc operation with a segment-completing close path operation, using the same parameters as previously.

But if SCZ-ops don't make it to the standard, then I would lean toward being consistent and not using closepath operations at all. Indeed, since we wouldn't be able to use closepath for rounded rectangles, then for consistency you shouldn't do it for actual rectangle either.

Well... actually, now that I think about it, an elegant solution is to *start* the path with a rounded corner, so that both in the rounded and non-rounded case, we end up with a straight line, which we can do with a regular closepath operation ;-)

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

Received on Saturday, 23 November 2019 17:47:15 UTC