Expand description
CSS clip-path 解析および内外判定・幾何計算モジュール。
W3C CSS Masking Module Level 1 準拠:
- 基本形状:
circle(),ellipse(),inset(),polygon() - 単位解決:
px,%,rem(16px),em(font_px),pt(4/3px), 裸数値 - キーワード位置:
left,top,right,bottom,center inset()の角丸半径(round構文)polygon()の fill-rule(nonzero,evenodd)
Enums§
Functions§
- clip_
inside - Returns
trueif point(ox, oy)in element-local pixels is inside the clip shape. 計算量: O(V) — V は多角形の頂点数(polygon()の場合)。 円・楕円・矩形は O(1)。 - clip_
len - clip_
len_ with_ font - clip_
pos - clip_
pos_ with_ font - parse_
clip_ shape - Parse CSS
clip-pathvalue into pixel coordinates relative to the element.wandhare the element’s rendered width and height in pixels. - parse_
clip_ shape_ with_ font - Parse CSS
clip-pathvalue with element font size for resolvingemunits. - point_
in_ rounded_ rect - polygon_
contains 🔒 - even-odd 規則(既定のfill-rule)での内外判定。自己交差の無い多角形では nonzero と同じ結果になるが、自己交差する多角形では領域の解釈が異なる。
- polygon_
contains_ 🔒nonzero - nonzero 規則(
clip-path: polygon(nonzero, ...))での内外判定。各辺との交差方向 (上向き/下向き)を winding number として加減算し、合計が0でなければ内側とする。