path-rite

reflectYAround

Mirror a path across a horizontal axis at a given y coordinate.

reflectYAround(svgPath: string, centerY: number): string

svgPath — SVG path d-attribute string.

centerY — Y coordinate of the horizontal mirror axis.

Returns — A new SVG path string mirrored across y = centerY.

// Mirror across the vertical center of a 200-tall canvas
const mirrored = pathRite.reflectYAround("M 0 10 L 50 10 L 50 60 Z", 100);