svg视图框分辨率限制 [英] svg viewbox resolution limits

查看:215
本文介绍了svg视图框分辨率限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道svg元素的视图框是否有任何硬性限制.当我达到非常低的值(例如,vb宽度在.002左右)或非常大的值时,我看到怪异的裁剪效果.Firefox在200000000宽度附近开始变得有趣.

I was wondering if there are any hard limits to the viewbox of a svg element. I see weird clipping when I reach very low values ( say when vb width is around .002 ) or very large ones firefox starts to play funny around 200000000 width.

有规则,可以在哪里找到当前限制的规范吗?

Is there a rule, a spec somewhere where I can find the current limits ?

在这里拨弄: var dim = 0.00002; http://jsfiddle.net/7v36sLj8/13/

您会看到有趣的事情从昏暗的地方开始发生,您可以将其降低10倍,也可以将其提高10倍.

You'll see funny things starting to happen from that dim onwards, you can decrease by a factor 10 or increase by a factor 10 as fitting.

感谢您的回答,我只考虑最小公分母的最小值/最大值. (感谢您的回答,Rob的回答也解释了为什么fox在linux/osx上的门槛要低得多.)

Thanks for the answers, I'll just take the min/maxes for the lowest common denominator which seems to be ffox for now. ( thanks for answers, also Rob's answer explains why ffox has a much lower threshold on linux / osx).

推荐答案

Firefox最初使用名为 cairo 的图形库来跨平台图形渲染.开罗只允许单位具有32位的定点二进制精度,因此Firefox选择了二进制点之前的24位和二进制分数的8位.因此,最大坐标为2 ^ 24,最小增量为1/256.

Firefox originally used a graphics library called cairo to do cross platform graphics rendering. Cairo only allows units to have 32 bits of fixed point binary precision so Firefox chose 24 bits before the binary point and 8 bits of binary fraction. So the maximum co-ordinates are then 2^24 and the smallest deltas 1/256.

Firefox一直在用更直接的平台呈现方式来替换cairo,例如如果您具有支持硬件加速的图形芯片并启用了硬件加速,则Windows上的Direct2D优先于cairo使用.平台库没有cairo范围限制,但似乎有自己的错误,且坐标较大.

Firefox has been replacing cairo with more direct platform rendering e.g. Direct2D on Windows which is used in preference to cairo now if you have a hardware acceleration capable graphics chip and have hardware acceleration enabled. The platform libraries don't have the cairo range limitation but do seem to have their own bugs with large co-ordinates.

这篇关于svg视图框分辨率限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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