Excanvas vml positioning issue

强颜欢笑 提交于 2019-12-06 09:01:03

问题


I've slogged my way through implementing excanvas on ie8. I've got the dynamic element bit sorted, the initially-hidden elements are now happily rendering throughout most of the app, and just when all seemed to be well I've hit another roadblock. The vml items rendered inside the div that excanvas generates are all offset by a large amount.

I only discovered what was happening by setting overflow:visible on all children of canvas, which caused the offset vml to become visible.
I've got a screenshot of the offending articles; the area in blue is the generated div in the correct position, and the items bordered in red should be within the blue area.

Has anyone encountered this before, and even better, been able to solve it?

Cheers!


回答1:


In case anyone ever encounters this error, it seems the issue was with a translate() call. Although I was using save and restore, and every standard implementation of canvas interpreted the translate call as I intended, in excanvas the translate was persistently additive.

I solved the issue by restoring the identity matrix before performing the other save, translate & restore calls.

context.setTransform(1,0,0,1,0,0);


来源:https://stackoverflow.com/questions/8112496/excanvas-vml-positioning-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!