SVGTransform:setSkewY() 方法
SVGTransform
接口的 setSkewY()
方法将变换类型设置为 SVG_TRANSFORM_SKEWY
,其中参数 angle
定义了 Y 轴的倾斜量。
语法
js
setSkewY(angle)
参数
angle
-
一个定义倾斜角度(以度为单位)的浮点数。
返回值
无(undefined
)。
异常
NoModificationAllowedError
DOMException
-
如果属性或
SVGTransform
对象是只读的,则抛出此异常。
示例
沿 Y 轴倾斜 SVG 元素
js
// Select an SVG element and create a transform object
const svgElement = document.querySelector("svg");
const transform = svgElement.createSVGTransform();
// Apply a skew of 30 degrees along the Y-axis
transform.setSkewY(30);
// Log the applied transformation angle
console.log(`Skew Angle: ${transform.angle}`); // Output: 30
规范
规范 |
---|
Scalable Vector Graphics (SVG) 2 # __svg__SVGTransform__setSkewY |
浏览器兼容性
加载中…