Svg.filter.window.overlap: def of gralha-svg-render@0.1.0.1 Import: import gralha-svg-render@0.1.0.1/svg.bend as Svg Lines 4765-4774 of gralha-svg-render@0.1.0.1/svg.bend: https://jend.leeeet.dev/read.txt?path=gralha-svg-render@0.1.0.1/svg.bend&start_line=4765&end_line=4774 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def filter.window.overlap(region: Bounds, local: Bounds) -> F32: Bounds{x0, y0, x1, y1} = region Bounds{u0, v0, u1, v1} = local +a0 = u0 +b0 = v0 +a1 = u1 +b1 = v1 +w = U.max(0.0, (U.min(x1, a1) - U.max(x0, a0) : F32)) +h = U.max(0.0, (U.min(y1, b1) - U.max(y0, b0) : F32)) (w * h / U.max(((a1 - a0) * (b1 - b0) : F32), 0.000000001) : F32) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=Bounds https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=max https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=min