mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-26 03:06:56 -06:00
A running header (or any text variable) in a parent-page frame was empty or wrong on pages whose page number repeats an earlier one: with two sections that both number from 1 (front matter 1-10, body 1-...), body pages 1-10 showed nothing. The renderer and PDF export passed only the page's name to the composition cache, which looked the page up as the first page with that name - in the front matter, before any heading. CompositionCache::get now takes the absolute page index (None for a story's own frames) and derives the name for page-number markers from it; the cache is keyed by index, so two pages with the same name no longer share a composed header. The renderer and PDF export pass first_page_of_spread + i. Test: running_header_on_parent_page_with_repeated_page_numbers (pages named 1, 2, 1, 2; the only heading on the third page). Before the fix the third page's header was empty (0 glyphs); with it, "Epsilon" (7). Found with an InDesign IDML (a dictionary with two sections and Match Character Style running headers on its parent page), together with #301. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CgGsJkVe5GYG9qK6VFdECa