def clip.attach

gralha-svg-render@0.1.0.1 · svg.bend:2509

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
import gralha-xml-doc@0.1.0.1/xml.bend as XML

2509def clip.attach(+as: List<&2, XML.Attr>, +all: List<&2, XML.Element>, box: Bounds, m: Matrix,
2510  build: List<&2, XML.Element> -> Matrix -> Clip) -> Clip:
2511  +value = XML.attr.get(as, "clip-path", "none")
2512  U.branch(Clip, U.prefix(value, "url("),
2513    _ => clip.reference(resource.find(all, U.drop(U.unquote(U.trim.both(U.scan.head(U.until(U.drop(value, "url("), 41, "")))), "#")),
2514      box, m, build), _ => ClipAll{})
2515
2516@unsafe

Uses (16)

Used by (2)