MCPcopy
hub / github.com/canvg/canvg / getDefinition

Method getDefinition

src/Property.ts:285–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283 }
284
285 getDefinition<T extends Element>() {
286 const asString = this.getString()
287 const match = /#([^)'"]+)/.exec(asString)
288 const name = match?.[1] || asString
289
290 return this.document.definitions.get(name) as T | undefined
291 }
292
293 getFillStyleDefinition(element: Element | PathElement, opacity: Property) {
294 let def = this.getDefinition<PatternElement & GradientElement>()

Callers 12

buildFunction · 0.80
constructorMethod · 0.80
elementMethod · 0.80
measureTargetTextMethod · 0.80
renderChildrenMethod · 0.80
createGradientFunction · 0.80
renderFunction · 0.80
applyEffectsFunction · 0.80
getTextMethod · 0.80

Calls 1

getStringMethod · 0.95

Tested by

no test coverage detected