Raphaeljs IE8 setViewBox not working
Asked Answered
D

0

6

I use RaphaelJS for generate SVG. My SVG is 1024px width and height. I use setViewBox because the div containing it is more small than 510px width and height.

With IE8 RaphaelJS produces VML but setViewBox is not working, the size of VML produced is 1024px.

How I can make that VML responsive?

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%");
}
Dialogism answered 24/4, 2015 at 8:33 Comment(3)
Your question title does not really hint to a problem, please change the title to a more descriptive line for your problem.Instability
Did you ever find a solution to this? It seems like there are some bugs in the recent versions of Raphael in the VML module, see for example Raphael.js function getBBox give back NAN/NAN/NAN in IE8 which is tracable to some wonky code related to VML viewboxes. For me in 2.2.0 and 2.2.1 setViewBox doesn't zoom and the VML element event when set with % widths doesn't scale responsivelyGaivn
I use more VML so I have no solution SryDialogism

© 2022 - 2024 — McMap. All rights reserved.