← 返回首页
SVGClipPathElement: transform プロパティ - Web API | MDN

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

SVGClipPathElement: transform プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.

transformSVGClipPathElement インターフェイスの読み取り専用プロパティで、 <clipPath> 要素の transform 属性(この要素に適用される座標変換のリスト)を反映します。

In this article

SVGTransformList です。

html, body, svg { height: 100%; }
html
<div> <svg viewBox="0 0 100 100" width="200" height="200"> <clipPath id="clip1" clipPathUnits="objectBoundingBox" transform="skewX(40) scale(1 0.5)"> <circle cx=".5" cy=".5" r=".35" /> </clipPath> <rect id="r1" x="0" y="0" width="100" height="100" /> <use clip-path="url(#clip1)" href="#r1" fill="lightblue" /> </svg> </div> <pre id="log"></pre>
js
const translateType = [ "unknown", "matrix()", "translate()", "scale()", "rotate()", "skewx()", "skewy()", ]; const clipPath1 = document.getElementById("clip1"); const log = document.getElementById("log"); let result = "次の座標変換が適用されています。\n"; for (const transform of clipPath1.transform.baseVal) { result += `- '${translateType[transform.type]}' 型の座標変換が見つかりました。\n`; } log.textContent = result;

仕様書

Specification
CSS Masking Module Level 1
# dom-svgclippathelement-transform

ブラウザーの互換性

Enable JavaScript to view this browser compatibility table.

関連情報