Comments (8)
Does SVG currently define how degenerate open paths render?
PDF recently clarified that the rendering depends on cap.
Rounds caps render a circle, anything else doesn't render.
from svgwg.
Test: https://jsfiddle.net/dodgeyhack/ze5v5ep0/
from svgwg.
In Error handling in path data it says:
As mentioned in Stroke Properties, linecaps must be painted for zero length subpaths when ‘stroke-linecap’ has a value of round or square.
And the recently rewritten Path directionality section defines the orientation of the linecaps (and markers).
from svgwg.
Reading the Error handling in path data join-linecap link above, I would say that the currently described result is that even for a closed sub-path, the linecap type defines the result.
The suggestion that the rendered result should be dependent on the linejoin style is nice for the example given. But I'm not sure it's good for all cases, i.e. choosing that option would preclude closed paths with round linejoins from ever disappearing - plus you would have to define additional results for each linejoin type.
I prefer keeping the behaviour of using the linecap style so that open and closed zero length subpaths are equivalent.
It also aligns with PDF for round and butt caps - I think we have different behaviour for square caps.
And I think there's some browser bugs regarding orientation of the caps.
from svgwg.
I’m ok to forget my suggestion to use line joins, consistency with pdf sounds good.
Perhaps you can make the spec clearer? See comment 3 for inconsistencies: https://bugs.chromium.org/p/skia/issues/detail?id=4784#c3
from svgwg.
Some test results:
Butt | Square | Round | |
---|---|---|---|
Expected | nothing | square | round |
FireFox (OS X) | nothing | star | round |
Chrome (OS X) | nothing | nothing | nothing |
Safari | nothing | square | round |
Edge | nothing | square | round |
Looks like we'll need to talk to the Chrome guys.
from svgwg.
RESOLUTION: zero length closed subpaths should render the same as zero length open subpath using the stroke-linecap to determine the result
https://www.w3.org/2016/02/18-svg-minutes.html#item01
I'll file a bug on Chrome
from svgwg.
https://bugs.chromium.org/p/chromium/issues/detail?id=588856
from svgwg.
Related Issues (20)
- Sizing properties section should link to a more recent references
- Should SVG's `<script>` element support the `fetchpriority` attribute analogous to HTML's `<script>` element? HOT 2
- Should support async and defer attributes on script elements
- Specification of the behaviour of `inline-size: 0`
- No way to construct a TimeEvent, so its initTimeEvent method is fully useless
- The IDL of SVGSVGElement.getElementById does not allow null
- Should SVG's `<image>` element support the `fetchpriority` attribute analogous to HTML's `<img>` element? HOT 1
- Decimal point not allowed according to Path Data ENBF HOT 3
- Enable lazy loading for URLs on use href HOT 1
- Does SVG support Custom elements? HOT 1
- Error about drawto_command in SVG 2.0 path EBNF HOT 2
- What should happen when trying to insert empty strings or separators into SVGStringList
- SVGAElement.prototype.text should be removed HOT 6
- Serialization of transform functions and transform attribute.
- Update UA stylesheet rules to use :any-link instead of :visited or :link HOT 2
- Incorrect description of path horizontal and vertical movement HOT 7
- Publish current status of SVG
- Is the `path()` function allowed for the `d` property? HOT 2
- Can we fix arc interpolation? HOT 4
- Implementing CSS Text Wrapping in SVG HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svgwg.