Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Merge #524: Pathfinder section in Properties

aionggf1459e6e64dd
diff --cc ROADMAP.md
index bf51e9cc9,097b2e4bc..83338058d
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@@ -129,25 -129,7 +129,26 @@@ list) · [roadmap.md](docs/roadmap.md)
Newest first.
+ - **2026-10-11** · Properties gains InDesign's Pathfinder section (Add, Subtract, Intersect, Exclude Overlap, Minus Back) with several objects selected; section titles and icon buttons have accessible names. No readiness percentage change.
+- **2026-10-11** · `transform.move {copy}`, Edit › Duplicate and Step and Repeat return the copies' ids, so a script can go on with them. No readiness percentage change.
+- **2026-10-11** · `object.fill` and `object.stroke` refuse a swatch name the document doesn't have (it painted nothing) and suggest the name meant (`Paper` → `[Paper]`). No readiness percentage change.
+- **2026-10-11** · Japanese captions now cover print ranges, imported style handling and table
+ row/column movement, including row-height distribution. Existing translation and RTL helpers
+ handle the display; command IDs, stored option values and user-defined style names are unchanged.
+- **2026-10-11** · Moving a sheared and rotated text frame no longer leaves trails of text behind: canvas repaints cover the frame's whole text box, not just its outline. No readiness percentage change.
+- **2026-10-11** · Live corners: the yellow widget on a selected rectangle frame shows corner
+ diamonds; dragging one rounds the corners, Alt-click steps the corner shape (#186).
+- **2026-10-11** · Optical kerning (#181): pairs are spaced from their outlines (ink gap per band,
+ pulled towards the font's stem gap, bounded) instead of silently using the font's kern pairs.
+- **2026-10-11** · New Document laid out like InDesign's (#325): Recent, Saved, Print, Web and
+ Mobile preset tabs beside the preset's details; saved document presets live in the engine
+ (`file.savePreset`, `file.deletePreset`, `file.new {preset}`); `file.new` takes intent, units,
+ start page and per-edge bleed and slug.
+- **2026-10-11** · macOS: fonts that font services and managers activate (Adobe Fonts,
+ RightFont) are listed, read from the files CoreText has available (#261, #327).
+- **2026-10-11:** Document pages take their parent page's margins and columns (left or right parent page by side) and follow its changes unless they have their own; parent ruler guides draw and snap on the pages based on it. IDML import marks a page margin preference that differs from its parent as the page's own. No readiness percentage change.
+- **2026-10-11** · Document Setup laid out like InDesign's: Page Size, Margins (new: every
+ page's, `layout.documentSetup {margins}`), Bleed and Slug with links, Adjust Layout.
- **2026-10-10 (UI.4–UI.5):** Panel tabs can move into other groups, split the dock, float, resize and return to their saved locations through shared docking transactions. Layouts persist in custom workspaces; UI and control commands share the same validated action path. Shared pane geometry and widget-state theme application retain all five palettes and local fonts. Split panes send keyboard input only to the focused canvas and scope contextual toolbar IDs per pane. No readiness percentage change.
- **2026-10-10** · Version 0.6.0; releases add a Linux riscv64 tar.gz (cross-compiled, CLI
smoke-tested under QEMU).
diff --cc crates/ui-egui/src/icons.rs
index 74c9575c0,3021e7d3b..eac798497
--- a/crates/ui-egui/src/icons.rs
+++ b/crates/ui-egui/src/icons.rs
@@@ -536,16 -495,39 +536,48 @@@ pub fn paint(p: &Painter, r: Rect, name
_ => {}
}
}
+ // Pathfinder: a back square (top left) and a front one (bottom right), the result filled.
+ "pf-add" | "pf-subtract" | "pf-intersect" | "pf-exclude" | "pf-minus-back" => {
+ let (back, front) = ((3.0, 3.0, 13.0, 13.0), (7.0, 7.0, 17.0, 17.0));
+ match name {
+ "pf-add" => {
+ pen.frect(back.0, back.1, back.2, back.3);
+ pen.frect(front.0, front.1, front.2, front.3);
+ }
+ "pf-subtract" => {
+ pen.frect(3.0, 3.0, 13.0, 7.0);
+ pen.frect(3.0, 7.0, 7.0, 13.0);
+ pen.rect(front.0, front.1, front.2, front.3);
+ }
+ "pf-intersect" => {
+ pen.rect(back.0, back.1, back.2, back.3);
+ pen.rect(front.0, front.1, front.2, front.3);
+ pen.frect(7.0, 7.0, 13.0, 13.0);
+ }
+ "pf-exclude" => {
+ pen.frect(3.0, 3.0, 13.0, 7.0);
+ pen.frect(3.0, 7.0, 7.0, 13.0);
+ pen.frect(13.0, 7.0, 17.0, 17.0);
+ pen.frect(7.0, 13.0, 13.0, 17.0);
+ pen.rect(7.0, 7.0, 13.0, 13.0);
+ }
+ _ => {
+ pen.rect(back.0, back.1, back.2, back.3);
+ pen.frect(13.0, 7.0, 17.0, 17.0);
+ pen.frect(7.0, 13.0, 13.0, 17.0);
+ }
+ }
+ }
// ---- Properties panel glyphs (original drawings)
+ "clock" => {
+ pen.circle(10.0, 10.0, 7.5);
+ pen.line(&[(10.0, 5.5), (10.0, 10.0), (13.5, 12.5)]);
+ }
+ "preset-save" => {
+ pen.line(&[(3.0, 11.0), (3.0, 17.0), (17.0, 17.0), (17.0, 11.0)]);
+ pen.line(&[(10.0, 3.0), (10.0, 13.0)]);
+ pen.line(&[(6.5, 9.5), (10.0, 13.0), (13.5, 9.5)]);
+ }
"orient-portrait" => {
pen.rect(5.5, 3.0, 14.5, 17.0);
pen.fcircle(10.0, 8.0, 1.8);
diff --cc crates/ui-egui/src/panels/properties.rs
index bf79d1086,baf167447..02253274e
--- a/crates/ui-egui/src/panels/properties.rs
+++ b/crates/ui-egui/src/panels/properties.rs
@@@ -1798,53 -1727,29 +1803,74 @@@ pub fn wrap_panel(app: &mut DesignApp,
let _ = app.run("object.textWrap", json!({"mode": info.as_ref().map(|i| i.wrap).unwrap_or("boundingBox"), "offset": v}));
}
});
+ let Some(i) = info.as_ref().filter(|i| i.wrap == "boundingBox" || i.wrap == "contour") else { return };
+ let sides = [
+ ("bothSides", "Both Right & Left Sides"),
+ ("rightSide", "Right Side"),
+ ("leftSide", "Left Side"),
+ ("towardsSpine", "Side Towards Spine"),
+ ("awayFromSpine", "Side Away from Spine"),
+ ("largestArea", "Largest Area"),
+ ];
+ wrap_combo(app, ui, "wrap_side", "Wrap To", &sides, &[], &i.wrap_side, "side");
+ if i.wrap == "contour" && i.is_graphic {
+ // Detected edges, alpha channels and image paths aren't offered: composition doesn't read
+ // the image. An imported one shows by name and wraps around the frame.
+ let types = [("boundingBox", "Bounding Box"), ("graphicFrame", "Graphic Frame"), ("sameAsClipping", "Same as Clipping")];
+ let shown_only = [("detectEdges", "Detect Edges"), ("alphaChannel", "Alpha Channel"), ("photoshopPath", "Photoshop Path")];
+ wrap_combo(app, ui, "wrap_contour", "Contour Type", &types, &shown_only, &i.wrap_contour, "contour");
+ }
+}
+
+/// A Text Wrap panel choice: `opts` are offered, `shown_only` only name the current value.
+#[allow(clippy::too_many_arguments)]
+fn wrap_combo(
+ app: &mut DesignApp,
+ ui: &mut egui::Ui,
+ salt: &str,
+ caption_text: &str,
+ opts: &[(&str, &str)],
+ shown_only: &[(&str, &str)],
+ cur: &str,
+ key: &str,
+) {
+ ui.horizontal(|ui| {
+ caption(ui, crate::i18n::tr(&app.ui.language, caption_text));
+ let shown = opts.iter().chain(shown_only).find(|o| o.0 == cur).map_or(cur, |o| o.1).to_string();
+ egui::ComboBox::from_id_salt(salt).selected_text(crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, &shown))).width(170.0).show_ui(
+ ui,
+ |ui| {
+ for (k, l) in opts {
+ if ui.selectable_label(*k == cur, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, l))).clicked() {
+ let _ = app.run("object.textWrap", json!({ key: k }));
+ }
+ }
+ },
+ );
+ });
}
+ /// The Pathfinder operations, in the order of InDesign's Pathfinder buttons.
+ const PATHFINDER: [(&str, &str, &str); 5] = [
+ ("pf-add", "add", "Add"),
+ ("pf-subtract", "subtract", "Subtract"),
+ ("pf-intersect", "intersect", "Intersect"),
+ ("pf-exclude", "exclude", "Exclude Overlap"),
+ ("pf-minus-back", "minusBack", "Minus Back"),
+ ];
+
+ /// Properties › Pathfinder (several objects selected): combine them into one shape.
+ fn pathfinder_row(app: &mut DesignApp, ui: &mut Ui) {
+ ui.horizontal(|ui| {
+ ui.spacing_mut().item_spacing.x = 8.0;
+ for (icon, op, tip) in PATHFINDER {
+ if icon_toggle(ui, icon, false, crate::i18n::tr(&app.ui.language, tip)).clicked() {
+ let _ = app.run("object.pathfinder", json!({"op": op}));
+ }
+ }
+ });
+ }
+
/// Pathfinder panel: combine the selected shapes; make or release compound paths.
pub fn pathfinder_panel(app: &mut DesignApp, ui: &mut egui::Ui) {
crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Pathfinder")).strong());