I have a website that I'm working on, where we allow the creation of shapes, and we do this using the built-in svg created using javascript. I have a strange problem when svg is displayed correctly in Chrome, but in Firefox it cuts off part of the SVG. The code below is a star. In chrome, this manifests itself perfectly. In Firefox, I see only the top left 25% of the image or so.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg">
<head></head>
<body>
<svg shape-rendering="" preserveAspectRatio="none">
<polygon transform="rotate(0 100 100)" points="256.53212826312154,13.412653125,314.88080229627076,201.3216034012431,499.6516034012431,201.3216034012431,348.91752881560774,320.0009404178177,382.9542553349448,507.9098906940608,256.53212826312154,389.2305536774862,130.11000119129832,507.9098906940608,164.14672771063536,320.0009404178177,13.412653125,201.3216034012431,198.18345422997237,201.3216034012431,256.53212826312154,13.412653125" fill="rgb(49, 48, 255)" stroke="black" stroke-width="2.49125px" style="position: absolute; ">
</polygon>
</svg>
</body>
</html>
I'm not sure if we are doing something wrong or if this is a problem with Firefox. Interestingly, if I make the star smaller (for example, 1/4 of the size of this one), it will display fine in Firefox.
Thanks for the help!
source
share