Skip to content

v1.12.0 — Soft & gradient masks, multi-region clips

Choose a tag to compare

@ozgesolidkey ozgesolidkey released this 30 Sep 11:18
· 3 commits to main since this release

Bet 2 — Living shapes: soft & gradient masks, multi-region clips.

A clip mask no longer has to be one shape with a hard edge:

  • OGMultiRegionShape (com.solidkey.painpoints.shape) — combine several placed sub-shapes with a path op (union / intersect / difference / xor) into one clip: two portholes, or a diamond with a circular bite. A plain Compose Shape, so it drops into the existing clipShape slot for image, GIF and video with zero consumer change. Outlines combined once per size, never per frame. Factories union(...) / of(...); OGClipRegion places a sub-shape in a normalized 0..1 sub-rect.
  • Modifier.ogSoftClip(shape, feather) + ogGradientMask(brush) (com.solidkey.painpoints.mask), surfaced on OGImageView as softEdge / maskBrush — feather a clip edge into a vignette, or fade content along a gradient, via one offscreen BlendMode.DstIn pass (no blur, no RenderEffect, no Android API floor). Scoped to Compose-drawn content (photo/GIF); video stays hard-clipped.

Zero new dependencies. 13 new tests green on JVM + iOS. Purely additive — every existing call compiles unchanged.

implementation("se.solidkey:kmpmedia-lib:1.12.0")

Docs: docs/SOFT_MASKS.md. See the README for live Android + iOS demo clips.