SVG box is rendered bigger than size + strokewidth (Firefox)

时间:2016-04-15 14:48:20

标签: firefox svg

I use the SVG tag to draw vectors on an html page. It seems that Firefox (45.0) renders lines with a specified stroke-width larger than expected.

I prepared an example with increasing stroke width, but the size which I can see in Firebug or FF object inspector are bigger, p.ex box size 100 + stroke width 10 results in object size 114. I expect 110 because the stroke protrudes on all sides of the box by stroke-width/2.

<svg>
  <path d="M550,10h100v100h-100z" style="stroke-width: 10; 
        stroke-linejoin: round;" stroke="#000000" fill="#ff0000"></path>
</svg>

https://jsfiddle.net/pv6dbb87/

Is this a Firefox issue? Is there a workaround?

0 个答案:

没有答案