Skip to content

v1.8.0 — Runtime SVG path `d` override

Choose a tag to compare

@ozgesolidkey ozgesolidkey released this 23 Sep 20:43
· 21 commits to main since this release

Runtime path geometry. Runtime-editable SVG can now change a node's shape, not just its paint and transform. An OGSvgNodeOverride may carry a replacement path d, and the addressed <path> re-parses to the new geometry live — no new node, no re-parse of the whole SVG. This is the building block for path morphing (the next roadmap step).

Purely additive: a new optional pathData field defaulting to null, so every existing call is unchanged. Same code on Android and iOS.

Added

  • OGSvgNodeOverride.pathData: String? — a replacement path d. When set on a node holding <path> geometry, the node redraws with this geometry instead of its original; null (default) keeps the original. Ignored on non-path nodes.

Notes

  • The new d is re-parsed against the SVG's viewBox (same user-space as the source), so the viewport transform and any paint/transform override on the node still apply on top. Reuses parsePathCommands; the resolve rebuilds a fresh shapes list and never mutates the parsed source tree.
  • Callers can compute a d per frame (e.g. interpolate between two same-structure paths) as a stop-gap until first-class path-morphing lands.
implementation("se.solidkey:kmpmedia-lib:1.8.0")

Cumulative superset — also includes SVG runtime overrides, image/GIF/video playback + clip-to-shape, depth-layer, polygon lasso, and audio sprites.