DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge #1703: Baseline grid: Relative To Top Margin starts the grid at each page's top margin
aiongge11f9f620222
diff --cc ROADMAP.mdindex 2204ca58d,4ce5bd0f0..001523158--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -350,7 -350,7 +350,8 @@@ list) · [roadmap.md](docs/roadmap.md)Newest first.+ - **2026-10-24** · The baseline grid's Relative To setting applies: with Top Margin, the grid starts at each page's own top margin in text composition, on the canvas and for snapping. It started at the page top, so grid-aligned text sat on the wrong lines and a page could fit one line fewer. No readiness percentage change.+- **2026-10-24** · Custom-positioned anchored objects honour Relative to Spine (`anchored.options {spineRelative}`, IDML `SpineRelative`): the settings describe a left-hand page and mirror on a right-hand page, so marginal notes stay in the outside margin on both pages of a spread. On right-hand pages they took the left-hand placement and landed in the inside margin, across the spine or over the body text. No readiness percentage change.- **2026-10-23** · Save and export dialogs (Save As, Save a Copy, Export PDF and the other exports, Package, libraries and books) start in the active document's folder once it has been saved, and for a document never saved in the folder of the last file saved or exported, remembered across sessions (#1653). A folder deleted since falls back to the system's choice. No readiness percentage change.- **2026-10-22** · Autoflow (Shift-click with the loaded text cursor, autoflow on Place, `text.thread {autoflow}`) fills the pages that follow before it adds any, as InDesign does: one frame per column on each following page, whatever else the page holds, then new pages at the end of the document. It inserted pages right after the story's last frame, in front of the document's own pages. Frames it set past the end of the text go again; a page the document had stays, and a page autoflow added only for such a frame goes with it. Smart Text Reflow of the primary text frame is unchanged. No readiness percentage change.- **2026-10-16** · Edit › Keyboard Shortcuts imports a set saved by InDesign's Show Set (.txt, Windows or Mac key names, UTF-8 or UTF-16): matched commands take its Default shortcuts or lose theirs, other commands give up keys it takes, and a report lists what it changed and the items it could not match (`window.importShortcuts`, #1180). Tool keys stay fixed. No readiness percentage change.diff --cc crates/compose/src/lib.rsindex a3fac1eab,49f9428c1..248e4d99c--- a/crates/compose/src/lib.rs+++ b/crates/compose/src/lib.rs@@@ -702,23 -698,17 +702,18 @@@ pub fn frame_specs(doc: &Document, sidlet prefix = sp.parent.as_ref().map(|p| p.prefix.clone()).unwrap_or_else(|| "A".into());// The side of the parent page under the frame, so a folio there aligns to the spine of its own page.let under = sp.page_at_x(center_x).and_then(|pi| sp.pages.get(pi));- let left = under.is_some_and(|p| p.side == designcraft_doc::PageSide::Left);- (Some(prefix), None, left)+ (Some(prefix), None, under.map(|p| p.side))}- _ => (None, None, false),+ _ => (None, None, None),};+ let left_page = side == Some(designcraft_doc::PageSide::Left);+ let right_page = side == Some(designcraft_doc::PageSide::Right);let section_marker = page.map(|abs| section_marker(doc, abs));- // The page under the frame and its margins, in inner space (bounding boxes).- let page_rect = match (spread_ref, spread) {- (_, Some(sp)) => sp- .page_at_x(center_x)- .and_then(|pi| sp.pages.get(pi))- .map(|pg| (inv.transform_rect_bbox(pg.bounds()), inv.transform_rect_bbox(pg.margin_rect()))),- _ => None,- };+ // The page under the frame, and its bounds and margins in inner space (bounding boxes).+ let under = spread.and_then(|sp| sp.page_at_x(center_x).and_then(|pi| sp.pages.get(pi)));+ let page_rect = under.map(|pg| (inv.transform_rect_bbox(pg.bounds()), inv.transform_rect_bbox(pg.margin_rect())));let g = &doc.settings.baseline_grid;- let (inc, start) = tf.options.baseline_grid.unwrap_or((g.increment, g.start));+ let (inc, start) = tf.options.baseline_grid.unwrap_or((g.increment, under.map_or(g.start, |pg| g.origin(pg))));// Grid lines are at spread y = start + n·inc (page tops are y = 0); map into inner space (translation only).let ty = xf.translation().y;let grid = (inc > 0.0).then_some((start - ty, inc));