Raphaeljs IE8 setViewBox not working

I am using RaphaelJS to generate SVG. My SVG has a width and height of 1024 pixels. I use setViewBox because the div containing it is smaller than the width and height of 510px.

In IE8, RaphaelJS creates VML, but setViewBox does not work, the size of the created VML is 1024px.

How can I respond to VML?

 paper = Raphael(document.getElementById("SVGDiv")); paper.canvas.id = 'paper'; paper.setViewBox(0,0,1024,1024); paper.setViewBox(0,0,1024,1024); image = paper.image("",0,0, 1024, 1024); text = paper.text(512, 512, ''); if( isIE() > 8 || isIE() == false){ paper.setSize("100%","100%"); } 
+6
source share

Source: https://habr.com/ru/post/985850/


All Articles