Fix
Overlays (image watermarks, text, redactions) rendered flipped / mispositioned on pages whose content stream applied a top-level CTM outside any q/Q and never restored it — e.g. tech sheets beginning with a y-flip:
0.75 0 0 -0.75 42.75 652.25 cm ← never restored; persists to end-of-stream
Editor.Apply appended overlay operators onto that leftover transform, so watermarks drew upside-down on exactly those pages. It now wraps each page's original content in q … Q, so overlays always start from the page's default (identity) CTM:
combined = "q\n" + existingContent + "\nQ\n" + overlayOpsApplies to all overlay types (AddImage, AddText, Redact).
Verification
- New regression test
TestOverlayIsolatesExistingCTM. - Validated on a real 50-page spec pack: pages that previously stamped upside-down now render upright (before/after via
mutool draw).
- Isolate page content CTM from overlays by @razvandimescu in #15
Full Changelog: v0.9.1...v0.9.2