简体   繁体   English

SVG模式不重复

[英]SVG pattern not repeating

I'm playing around with SVGs and was working off of this example. 我正在玩SVG,正在研究示例。 However, in my jsbin the pattern isn't repeating for my <rect> elements. 但是,在我的jsbin中,我的<rect>元素的模式没有重复。
And when I change the height and width attributes (no I'm not changing the x , y attributes) the rect svg objects just disappear when I enter in large values. 当我更改height和width属性(不更改x,y属性)时, rect svg对象在输入较大的值时就会消失。
I'm just dipping my toe into SVGs so my knowledge is quite limited. 我只是将脚趾浸入SVG,所以我的知识非常有限。 I figure it is something simple but am not seeing what I'm doing incorrectly when I compare to what I'm doing to the grid2.svg that I'm going off of. 我认为这很简单,但是与我要处理的grid2.svg进行比较时,并没有看到我做错了什么。

You've written this... 你写了这个...

<pattern id="OvalPattern2" patternUnits="objectBoundingBox" width="70" height="70" >

With objectBoundingBox units 1 is the size of the shape using it. 对于objectBoundingBox,单位1是使用它的形状的大小。 So your pattern is 70 times the size of the object using it. 因此您的图案是使用该图案的对象大小的70倍。 I suspect you want .7 as the width/height. 我怀疑您想要.7作为宽度/高度。

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

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