def style.outline

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

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

2547def style.outline(+s: Style, +es: List<&2, Edge>, +m: Matrix, ref: F32, declared: F32) -> StrokeMesh:
2548  Style{fill, stroke, col, fo, so, width, even, visible, ss, ms, rendering, order} = s
2549  +screen = style.nonScaling(s)
2550  stroke.mesh(U.branch(List<&2, Edge>, U.string.equal(stroke, "none") || F32.is_le(width, 0.0), _ => Nil{},
2551    _ => stroke.compile(U.choose(List<&2, Edge>, screen, edges.transform(es, m), es), (width / 2.0 : F32), ss, ref, declared, U.choose(F32, screen, 1.0, matrix.norm(m)))),
2552    U.choose(Matrix, screen, identity(), matrix.inverse(m)))

Uses (19)

Used by (1)