SVGAngle: unitType プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
値
数値で、定数の数値の値を表します。
例
unitType
プロパティにアクセスする方法の例を以下に示します。
js
// SVGAngle オブジェクトを取得
const svg = document.querySelector("svg");
const angle = svg.createSVGAngle();
// 角度の値を設定
angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 45);
// 単位型をチェック
console.log(angle.unitType); // 出力: 2 (SVG_ANGLETYPE_DEG)
仕様書
Specification |
---|
Scalable Vector Graphics (SVG) 2 # __svg__SVGAngle__unitType |