diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/svg/attribute/shape-rendering | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/svg/attribute/shape-rendering')
-rw-r--r-- | files/zh-cn/web/svg/attribute/shape-rendering/index.html | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/files/zh-cn/web/svg/attribute/shape-rendering/index.html b/files/zh-cn/web/svg/attribute/shape-rendering/index.html new file mode 100644 index 0000000000..c99a0e3104 --- /dev/null +++ b/files/zh-cn/web/svg/attribute/shape-rendering/index.html @@ -0,0 +1,83 @@ +--- +title: shape-rendering +slug: Web/SVG/Attribute/shape-rendering +tags: + - SVG + - SVG线条渲染 + - 需要完善 +translation_of: Web/SVG/Attribute/shape-rendering +--- +<p>« <a href="/zh-CN/docs/Web/SVG/Attribute" title="en/SVG/Attribute">SVG 属性参考主页</a></p> + +<p>指定SVG元素{{SVGElement("path")}}的渲染模式。</p> + +<h2 id="使用参考">使用参考</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="row">类型</th> + <td>外观属性</td> + </tr> + <tr> + <th scope="row">值</th> + <td><strong title="this is the default value">auto</strong> | optimizeSpeed | crispEdges | geometricPrecision | inherit</td> + </tr> + <tr> + <th scope="row">可运动</th> + <td>Yes</td> + </tr> + <tr> + <th scope="row">标准文档</th> + <td><a class="external" href="http://www.w3.org/TR/SVG11/painting.html#ShapeRenderingProperty" title="http://www.w3.org/TR/SVG11/painting.html#ShapeRenderingProperty">SVG 1.1 (2nd Edition)</a></td> + </tr> + </tbody> +</table> + +<dl> + <dt>auto</dt> + <dd>让浏览器自动权衡渲染速度、平滑度、精确度。默认是倾向于精确度而非平滑度和速度。</dd> + <dt>optimizeSpeed</dt> + <dd>偏向渲染速度,浏览器会关闭反锯齿模式。(速度)</dd> + <dt>crispEdges</dt> + <dd>偏向更加清晰锐利的边缘的渲染。浏览器在渲染的时候会关闭反锯齿模式,且会让线条的位置和宽度和显示器边缘对齐。(锐度)</dd> + <dt>geometricPrecision</dt> + <dd>偏向渲染平滑的曲线。(平滑)</dd> +</dl> + +<h2 id="示例">示例</h2> + +<pre class="brush: xml"><svg xmlns="http://www.w3.org/2000/svg" + version="1.1" width="100" height="100" + shape-rendering="optimizeSpeed"><!-- 这个示例在Firefox下看区别更明显 --></pre> + +<table class="standard-table"> + <tbody> + <tr> + <td> + <p>shape-rendering: geometricPrecision:</p> + + <p><img alt="shape-rendering:geometricPrecision" src="http://download.g63.ru/svg/shape-rendering-geometricPrecision.svg" style="height: 210px; width: 200px;"></p> + </td> + <td> + <p>shape-rendering: optimizeSpeed</p> + + <p><img alt="shape-rendering:optimizeSpeed" src="http://download.g63.ru/svg/shape-rendering-optimizeSpeed.svg" style="height: 210px; width: 200px;"></p> + </td> + </tr> + </tbody> +</table> + +<p>同样,你也可以在css样式中使用shape-rendering:</p> + +<pre class="brush: xml"><svg xmlns="http://www.w3.org/2000/svg" + version="1.1" width="100" height="100" + style="shape-rendering:optimizeSpeed;"></pre> + +<h2 id="关联元素">关联元素</h2> + +<p>下面的元素可以使用这个属性</p> + +<ul> + <li><a href="/en/SVG/Element#Shape" title="en/SVG/Element#Shape">Shape elements</a> »</li> +</ul> |