DmitryBaranovskiy / raphael

JavaScript Vector Library
https://dmitrybaranovskiy.github.io/raphael/
MIT License
11.26k stars 1.67k forks source link

.image problem with ie8 zoom #361

Open Barfly opened 13 years ago

Barfly commented 13 years ago

Hello, when i use ".image" in ie8 and then i set my browser zoom at 125% the images are cropped. But this isn't happening when i set the zoom to 100%, 200% or 400%.

Kimitri commented 12 years ago

I've got this same exact problem. We just released a new site for our client that uses Raphaël to draw a funky, animated pie chart that showcases the services they provide. Everything works fine except Paper.image() when the page is zoomed. (The text blocks and the grey blob in the center are PNGs.) The site in question is Sodexo.fi.

jamesdh commented 12 years ago

Duplicate/related to #378

ratty1979 commented 11 years ago

Has this issue been resolved or any workaround?

TfGizmo commented 11 years ago

example Having the same issue. Using images on a canvas, setting the IE zoomlevel to anything other than a whole "100", and the images are clipped and resized incorrectly. Does this at the example page here http://raphaeljs.com/image-rotation.html as well (as long as you set the IE zoomlevel to anything other than 100's).

In other browsers, this works without issues. IE8 and IE9 tested false.

wizrides commented 11 years ago

Also having the same issue in the current release. Seems there is a circular reference for issues #361 and #378 and they are both marked as closed but are not resolved in the latest release.

vangliana commented 11 years ago

does anyone know if this issue has been resolved?

xenosteel commented 10 years ago

After a lot of pain, I finally managed to find a fix that EXACTLY fixes this issue: http://ama2595.blogspot.fr/2012/08/fixing-image-size-of-raphaeljs-image-in.html

According to the blog author, there's an issue in Raphael JS itself when its trying to convert the SVG images to VML.

Here's the fix:

Line number 4952 missing “pt” constant that has to be present in VML tag. So just changing

fill.size = .fillsize[0] * abs(sx) + S + .fillsize[1] * abs(sy);

to something like

fill.size = .fillsize[0] * abs(sx)/1.34 + "pt" + S + .fillsize[1] * abs(sy)/1.34 + "pt";

NOTE: In my case it was line 7303

Hope this helps somebody!