SVG path interface
SVGPathElement
接口对应于<path>
元素。
接口概览
又作用于 | SVGElement 、 SVGTests 、 SVGLangSpace 、 SVGExternalResourcesRequired 、 SVGStylable 、 SVGTransformable 、 SVGAnimatedPathData |
---|---|
方法 |
|
属性 |
|
规范文档 | SVG 1.1 (2nd Edition) |
属性
名称 | 类型 | 描述 |
---|---|---|
pathLength |
SVGAnimatedNumber |
对应于给定<path> 元素的pathLength 属性。 |
方法
名称和参数 | 返回 | 描述 |
---|---|---|
getTotalLength () |
浮点数 | 返回用浏览器的 distance-along-a-path 算法计算得出的路径全长,匹配当前用户坐标系中的长度。 |
getPointAtLength(in float distance) |
SVGPoint |
Returns the (x,y) coordinate in user space which is distance units along the path, utilizing the browser's distance-along-a-path algorithm. |
getPathSegAtLength(in float distance) |
无符号长整型 | Returns the index into pathSegList which is distance units along the path, utilizing the user agent's distance-along-a-path algorithm. |
createSVGPathSegClosePath() |
SVGPathSegClosePath |
Returns a stand-alone, parentless SVGPathSegClosePath object. |
createSVGPathSegMovetoAbs(in float x, in float y) |
SVGPathSegMovetoAbs |
Returns a stand-alone, parentless SVGPathSegMovetoAbs object.Parameters:
|
createSVGPathSegMovetoRel(in float x, in float y) |
SVGPathSegMovetoRel |
Returns a stand-alone, parentless SVGPathSegMovetoRel object.Parameters:
|
createSVGPathSegLinetoAbs(in float x, in float y) |
SVGPathSegLinetoAbs |
Returns a stand-alone, parentless SVGPathSegLinetoAbs object.Parameters:
|
createSVGPathSegLinetoRel(in float x, in float y) |
SVGPathSegLinetoRel |
Returns a stand-alone, parentless SVGPathSegLinetoRel object.Parameters:
|
createSVGPathSegCurvetoCubicAbs(in float x, in float y, in float x1, in float y1, in float x2, in float y2) |
SVGPathSegCurvetoCubicAbs |
Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.Parameters:
|
createSVGPathSegCurvetoCubicRel(in float x, in float y, in float x1, in float y1, in float x2, in float y2) |
SVGPathSegCurvetoCubicRel |
Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.Parameters:
|
createSVGPathSegCurvetoQuadraticAbs(in float x, in float y, in float x1, in float y1) |
SVGPathSegCurvetoQuadraticAbs |
Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.Parameters:
|
createSVGPathSegCurvetoQuadraticRel(in float x, in float y, in float x1, in float y1) |
SVGPathSegCurvetoQuadraticRel |
Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.Parameters:
|
createSVGPathSegArcAbs(in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag) |
SVGPathSegArcAbs |
Returns a stand-alone, parentless SVGPathSegArcAbs object.Parameters:
|
createSVGPathSegArcRel(in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag) |
SVGPathSegArcRel |
Returns a stand-alone, parentless SVGPathSegArcRel object.Parameters:
|
createSVGPathSegLinetoHorizontalAbs(in float x) |
SVGPathSegLinetoHorizontalAbs |
Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.Parameters:
|
createSVGPathSegLinetoHorizontalRel(in float x) |
SVGPathSegLinetoHorizontalRel |
Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.Parameters:
|
createSVGPathSegLinetoVerticalAbs(in float y) |
SVGPathSegLinetoVerticalAbs |
Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.Parameters:
|
createSVGPathSegLinetoVerticalRel(in float y) |
SVGPathSegLinetoVerticalRel |
Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.Parameters:
|
createSVGPathSegCurvetoCubicSmoothAbs(in float x, in float y, in float x2, in float y2) |
SVGPathSegCurvetoCubicSmoothAbs |
Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.Parameters
|
createSVGPathSegCurvetoCubicSmoothRel(in float x, in float y, in float x2, in float y2) |
SVGPathSegCurvetoCubicSmoothRel |
Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.Parameters
|
createSVGPathSegCurvetoQuadraticSmoothAbs(in float x, in float y) |
SVGPathSegCurvetoQuadraticSmoothAbs |
Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs object.Parameters:
|
createSVGPathSegCurvetoQuadraticSmoothRel(in float x, in float y) |
SVGPathSegCurvetoQuadraticSmoothRel |
Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel object.Parameters:
|
浏览器兼容性
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | ? | ? | ? | ? | ? |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | 未实现 | ? | ? | ? | ? |
参见
<path>
SVG Element