Excanvas vml定位问题 [英] Excanvas vml positioning issue

查看:200
本文介绍了Excanvas vml定位问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过在ie8上实施excanvas来阻止我的方式。我有动态元素位排序,最初隐藏的元素现在愉快地呈现在大部分的应用程序,只是当所有似乎都很好,我打了另一个路障。
在excanvas生成的div内部显示的vml项目都被大量偏移。



我只发现了通过设置overflow:在所有的canvas画布上显示,导致偏移vml变为可见的情况。

I' ve得到了违规文章的截图;蓝色区域是在正确位置生成的div,以红色标记的项目应该在蓝色区域内。



>



有没有人遇到过这个,甚至更好,能够解决它吗?



解决方案

如果任何人遇到此错误,似乎问题是与一个translate()调用。虽然我使用保存和恢复,并且每个标准实现帆布解释平移调用,我想要的,在excanvas中的翻译是持续地加。



我通过恢复单位矩阵来解决这个问题,然后再执行另一个save,translate&恢复调用。

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


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!

解决方案

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);

这篇关于Excanvas vml定位问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆