Open isadovskiy opened 10 years ago
This is most likely related to #731. Check out my comment that has more detail. I really think the whole transform()
method needs a re-write for VML because there are a lot of bugs creeping up.
@isadovskiy could you provide a pull request with your fix? @TheCloudlessSky do you think that this would fix this issue and 731?
@tomasAlabes Unfortunately, that didn't fix it.
I will create pull request soon
This commit fixes the issue for me: https://github.com/isadovskiy/raphael/commit/4f244b4329d083b465cc1623a0867cd76d7b9707
Pushed to v2.1.2, any feedback before merging to master is appreciated.
Hello.
There is an issue with VML implementation of getBBox(). If paper.setViewBox() was called first, it affects el.matrix property internally in transform() method implementation for VML:
New matrix is calculated as a sum for viewBox and current transformation string. Later matrix property is used for getBBox() calculations for element and as a result returns values, different from SVG implementation.
The fix is to restore matrix at the end of the VML transform method (as it's currently done for _transform property):
Please note, explicit (oldt != null) comparison is required, since transform/matrix should also be restored if no transformation was set to element explicitly. "oldt" will be empty string in this case and should be restored as well.
This fix helped me to resolve the issue. However I'm not sure - probably it could break something else in the code. So need for approval from someone, who knows the internal code architecture better.
Regards, Igor