简体   繁体   English

Chrome和SVG(Raphael),无法绘制“屏幕外”图像

[英]Chrome and SVG (Raphael), trouble with drawing “off-screen”

I'm working on a prototype system which will act as a proof of concept that an existing system can be made a lot more interactive. 我正在开发一个原型系统,它将作为概念证明来证明现有系统可以变得更具交互性。

It basically emulates our main software package but over the internet using JSONP requests to update a load of images and Raphael vectors to make it look like everything's running. 它基本上模拟了我们的主要软件包,但使用JSONP请求在互联网上更新了图像和Raphael向量的负载,以使其看起来一切都在运行。

I'm having trouble on Chrome however with Raphael not drawing vectors "off-screen". 我在Chrome上遇到了麻烦,但是Raphael没有在屏幕外绘制矢量。 What I mean by "off-screen" is that the main app runs through an iframe as it relies on cross-domain long poll comet through AJAX to get communicate back and forth. 我所说的“屏幕外”是指主应用程序通过iframe运行,因为它依赖于通过AJAX进行的跨域长轮询彗星来回通信。 Below is an image demonstrating what I mean. 下面的图像演示了我的意思。

在此处输入图片说明

Here I've scrolled a long a little bit in the iframe to look at the bits "offscreen" and you can hopefully see that the grey arrows aren't rendered. 在这里,我在iframe中滚动了很长一段时间,以查看“屏幕外”位,您可以希望看到未显示灰色箭头。 I've used Chrome's developer tools to highlight over the SVN tag, showing that it's only given 450px by 810px to the SVG tag, which is the same size allocated for the iframe. 我已经使用Chrome的开发人员工具突出显示了SVN标签,显示出它只为SVG标签提供了450px x 810px的像素,这与为iframe分配的尺寸相同。

It's worth pointing out that it renders fine in Firefox. 值得指出的是,它在Firefox中呈现良好。 Any ideas? 有任何想法吗?

I've had a similar problem and found a bug report for the WebKit project that seemed related: 我遇到了类似的问题,并发现了与WebKit项目有关的错误报告:

https://bugs.webkit.org/show_bug.cgi?id=64823 https://bugs.webkit.org/show_bug.cgi?id=64823

According to the comments, it's a bug in the rendering engine and there's no workaround aside from losing the iframe or resorting to other means of scrolling the SVG viewport (like moving all the elements within the SVG element). 根据评论,这是渲染引擎中的错误,除了丢失iframe或诉诸其他滚动SVG视口的方式(如移动SVG元素内的所有元素)外,没有其他解决方法。

On the upside, version 16.0.912.21 has been released to the beta channel today and it seems that the bug has been fixed. 好的方面来说, 版本16.0.912.21已于今天发布到Beta通道,并且该错误似乎已得到修复。 I've also checked the latest chromium build (17.something) and the bug hasn't resurfaced. 我还检查了最新的铬生成(17.something),并且该bug尚未浮出水面。 I'm guessing the fix should find its way into the stable channel in a couple of weeks. 我猜想该修复程序应该在几周内进入稳定的渠道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM