You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WMF: ScaleViewportExt (and the other Offset/Scale mapping records) are ignored, so sub-pictures are drawn full size #2069
A WMF can draw several sub-pictures into parts of its frame: each one saves the DC, halves (or otherwise scales) the viewport with META_SCALEVIEWPORTEXT, sets its own window, draws, and restores the DC. Charts and clip art pasted from older Office versions are often stored like this. DeckCraft ignores the scale, so the first sub-picture is stretched over the whole frame and the next ones land outside it.
Version: deckcraft-cli 0.18.1 (built from tag v0.18.1, 7cc73ab), macOS 26.6.2, Intel. Same result with the 0.17.0 release.
SetWindowOrg 0, 0
SetWindowExt 800 x 400 ; the frame
SaveDC
SetMapMode MM_ANISOTROPIC
ScaleViewportExt x * 1/2, y * 1/1
SetWindowOrg 0, 0
SetWindowExt 400 x 400
Ellipse 20,20 – 380,380 ; red brush
RestoreDC -1
SaveDC
SetMapMode MM_ANISOTROPIC
ScaleViewportExt x * 1/2, y * 1/1
SetWindowOrg -400, 0 ; shifts this sub-picture into the right half
SetWindowExt 400 x 400
Ellipse 20,20 – 380,380 ; blue brush
RestoreDC -1
Expected vs actual
Expected (LibreOffice, ONLYOFFICE): a red circle in the left half and a blue circle in the right half.
Actual: one red ellipse stretched over the whole frame; no blue circle.
crates/metafile/src/wmf.rs (record, at 7cc73ab) handles META_SETWINDOWORG/EXT and META_SETVIEWPORTORG/EXT, but has no case for META_SCALEVIEWPORTEXT (0x0412), META_OFFSETVIEWPORTORG (0x0211), META_SCALEWINDOWEXT (0x0410) or META_OFFSETWINDOWORG (0x020F), so they fall through and are skipped ([MS-WMF] 2.3.5). #2064 moves this reader to craft-metafile; the same four cases are missing in craft-libs main too, so a fix would probably go there.
Activity
ticket-craft commentedon Nov 12, 2026
Possibly related: storytold/vectorcraft#2673 and #327.
This looks like a problem shared by several apps: VectorCraft and WordCraft.
craft-metafile: WMF scale and offset mapping records
kiwi5boy commentedon Nov 20, 2026
Taking this: bumping DeckCraft's craft-metafile pin past craft-libs #1816, with a regression test.
#2069: WMF scale and offset mapping records place sub-pictures
Merge pull request #2266 from kiwi5boy/ccr-3400a88a-qfiv9l
dotCooCoo commentedon Nov 22, 2026
Fixed in #2266, merged 2026-11-22. It is expected in v0.19.0.