mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-31 15:49:42 +00:00
Merge pull request #1232 from seanth/parent-page-display
Parent pages: document-page overlays no longer pile onto the parent canvas
This commit is contained in:
3 files changed
+30
-1
No files matched your search
@@ -523,6 +523,7 @@ Newest first.
|
||||
- **2026-10-18** · Table of Contents reserves the title field's width so Contents is readable next to its style picker; the grid previously squeezed it to a few characters. No readiness percentage change.
|
||||
- **2026-10-17** · Inline and anchored objects paint under their frame's text, on screen and in PDF, as InDesign draws them: a picture whose frame reaches into the next line (a negative Y offset) no longer hides the top of that line. No readiness percentage change.
|
||||
- **2026-10-17** · Running headers: *first/last on page* read a page in text order (story order, then column by column), not by height — a multi-column page's right header showed the lowest entry of column 1 instead of the page's last entry. No readiness percentage change.
|
||||
- **2026-10-17** · Parent pages: while parents are edited, the document pages' hidden characters, spelling squiggles and other overlays no longer pile onto the right parent page. No readiness percentage change.
|
||||
- **2026-10-16** · A Direct Selection click on an image whose frame is already selected selects the image, so Delete removes only the image and leaves the empty frame, as in InDesign. No readiness percentage change.
|
||||
- **2026-10-16** · Type › Reload Fonts (`font.reload`): fonts installed, edited or removed while DesignCraft runs are read again without a restart, and the open documents recompose with them (#328, #547). An edited font file is noticed by its length and modification time; bundled, added and document fonts stay as they are. InDesign does this by itself, so noticing changes automatically is still open (gap 6). No readiness percentage change.
|
||||
- **2026-10-16** · Parents can be deleted from their Pages-panel context menu or `layout.parents.delete {id}`. Applied-page and based-on references are cleared, local override copies survive, and Undo restores the parent. Addresses the deletion portion of #956; no readiness percentage change.
|
||||
|
||||
@@ -10,7 +10,10 @@ use super::{
|
||||
/// Spread-space → canvas transform for an item at `loc`.
|
||||
pub(super) fn item_canvas_xf(doc: &Document, layout: &CanvasLayout, id: designcraft_doc::ItemId) -> Option<(Affine, &'static str)> {
|
||||
let loc = doc.find(id)?;
|
||||
Some((layout.xf(loc.spread) * doc.parent_xf(&loc), ""))
|
||||
// Items on spreads that aren't laid out (document pages while parents are being edited, or
|
||||
// the reverse) have no place on the canvas.
|
||||
let slot = layout.slot(loc.spread)?;
|
||||
Some((slot.xf * doc.parent_xf(&loc), ""))
|
||||
}
|
||||
|
||||
pub(super) fn path_screen(it: &Item, xf: &Xf, a: Affine) -> Vec<Vec<Pos2>> {
|
||||
|
||||
@@ -1004,6 +1004,31 @@ fn overset_frames_are_found_inside_groups() {
|
||||
assert!(out.is_empty());
|
||||
}
|
||||
|
||||
/// While parents are edited, a document page's frames have no place on the canvas (they fell back
|
||||
/// to the identity transform and their ¶ marks and other overlays piled onto the right parent
|
||||
/// page), and the reverse.
|
||||
#[test]
|
||||
fn document_pages_have_no_place_on_the_parent_canvas() {
|
||||
let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
|
||||
app.run("file.new", json!({"pages": 2})).unwrap();
|
||||
let s = &mut app.session;
|
||||
let body =
|
||||
s.execute("frame.create", &json!({"rect": [36, 36, 300, 300], "content": "text", "text": "one\ntwo"})).unwrap()["id"].as_u64().unwrap();
|
||||
let head = s
|
||||
.execute("frame.create", &json!({"spread": {"kind": "parent", "index": 0}, "rect": [36, 10, 300, 30], "content": "text", "text": "head"}))
|
||||
.unwrap()["id"]
|
||||
.as_u64()
|
||||
.unwrap();
|
||||
let doc = app.session.doc().unwrap().doc.clone();
|
||||
let (body, head) = (designcraft_doc::ItemId(body), designcraft_doc::ItemId(head));
|
||||
let pages = CanvasLayout::new(&doc, false);
|
||||
assert!(item_canvas_xf(&doc, &pages, body).is_some());
|
||||
assert!(item_canvas_xf(&doc, &pages, head).is_none());
|
||||
let parents = CanvasLayout::new(&doc, true);
|
||||
assert!(item_canvas_xf(&doc, &parents, body).is_none(), "a page frame is not drawn over the parent");
|
||||
assert!(item_canvas_xf(&doc, &parents, head).is_some());
|
||||
}
|
||||
|
||||
/// The always-on overset mark sits at the frame's out port, a step along its own right edge
|
||||
/// (so a rotated frame gets it inside its edge, not straight up from the corner), and a
|
||||
/// selected overset frame gets only the mark its ports draw.
|
||||
|
||||
Reference in new issue
Block a user