GithubHelp home page GithubHelp logo

Comments (8)

nikosandronikos avatar nikosandronikos commented on July 26, 2024

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.

nikosandronikos avatar nikosandronikos commented on July 26, 2024

Test: https://jsfiddle.net/dodgeyhack/ze5v5ep0/

from svgwg.

heycam avatar heycam commented on July 26, 2024

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.

nikosandronikos avatar nikosandronikos commented on July 26, 2024

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.

karip avatar karip commented on July 26, 2024

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.

nikosandronikos avatar nikosandronikos commented on July 26, 2024

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.

nikosandronikos avatar nikosandronikos commented on July 26, 2024

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.

nikosandronikos avatar nikosandronikos commented on July 26, 2024

https://bugs.chromium.org/p/chromium/issues/detail?id=588856

from svgwg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.