mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-29 04:47:10 -06:00
Word plays a WMF into the picture's box the way a GDI player does: the placeable header's bounds are only the first window, mapped onto a viewport of the picture's size, and the file's own SETWINDOWORG and SETWINDOWEXT records replace that window. WordCraft mapped the header's bounds through the file's final mapping instead, which broke three pictures in docxide-pdf's fixtures: - bulgarian_farmland_allocation_order: the coat of arms draws in a window centred on the origin, nowhere near the header's bounds, so the lion was blown up into a solid black box. - ukrainian_municipal_heating_resolution: a portrait window replaced the landscape bounds, so the emblem was drawn at a fifth of its size. - A plain WMF in anisotropic mode that sets a window but no viewport kept the 1 x 1 default viewport and shrank to a point; its first window is now its target. Files that set their own viewport, or use the fixed-scale map modes, are read as before. SETROP2 is now read too: with R2_NOP, shapes and paths draw nothing (the coat of arms first draws its bounding rectangle that way, which showed as an outline). The mode is saved and restored with the DC. Co-authored-by: Naxvog <4963183+naxvog@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Brandon Thomas <echelon@gmail.com>