Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Precision of SVG coordinates?

Does anyone know the "official" precision of SVG coordinates in browsers?

For example: If I draw an arc with almost 360° it will eventually disappear because start and end are collapsing.

<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
    <style>
        path {
            stroke-width: 10px;
            stroke: black;
            fill: none;
        }
    </style>
    <path 
        d="
        M 200 200
        A 100 100 0 1 1 199.99999 199.99999"
    />
</svg>

draws a perfect circle (in Firefox 34). However, adding a 9 to 199.99999 yields to nothing being drawn. Is this behavior specified anywhere?

like image 243
Johannes Ewald Avatar asked Oct 19 '25 18:10

Johannes Ewald


1 Answers

The SVG specification says double precision. No UA implements this though because they are all constrained by platform capabilities such as direct3d which are generally single precision.

like image 122
Robert Longson Avatar answered Oct 24 '25 16:10

Robert Longson