diff --git a/crates/print/src/ui/dialog.rs b/crates/print/src/ui/dialog.rs index 5d4bd405d..b44d8b64c 100644 --- a/crates/print/src/ui/dialog.rs +++ b/crates/print/src/ui/dialog.rs @@ -309,14 +309,16 @@ impl Component for PrintPreview<'_> { } } // The description and the labels are text of the printed page; the preview shows where each stands. - // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) if marks.description { + // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) let from = paper.left_bottom() + vec2(MARK_GAP, -MARK_GAP); + // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) rule(RuleKind::Edge, from, from + vec2(MARK_LEN * 3.0, 0.0)); } - // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) if marks.labels { + // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) let from = paper.left_top() + vec2(MARK_GAP, MARK_GAP); + // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) rule(RuleKind::Edge, from, from + vec2(MARK_LEN * 3.0, 0.0)); } } diff --git a/crates/ui-patterns/src/patterns/form_dialogs/save_for_web/panes.rs b/crates/ui-patterns/src/patterns/form_dialogs/save_for_web/panes.rs index 1a11fd717..63b553a38 100644 --- a/crates/ui-patterns/src/patterns/form_dialogs/save_for_web/panes.rs +++ b/crates/ui-patterns/src/patterns/form_dialogs/save_for_web/panes.rs @@ -183,6 +183,7 @@ fn paint_slices(painter: &ContentPainterCx<'_>, view: CanvasTransform, picture: let number = slice.number.to_string(); painter.with_draw(|draw| { let run = TextRun::new(number.as_str()).role(TypeRole::Caption); + // design: allow[literal-size/vec2](the slice number sits a fixed 2 points inside the slice outline over the image preview) let corner = rect.left_top() + Vec2::splat(2.0); let layout = draw.layout(&run, f32::INFINITY); draw.galley(corner, &layout); diff --git a/design/exceptions/craft-draw/crate.toml b/design/exceptions/craft-draw/crate.toml index f283a2909..74c710de8 100644 --- a/design/exceptions/craft-draw/crate.toml +++ b/design/exceptions/craft-draw/crate.toml @@ -7,3 +7,11 @@ rule = "raw-colour/const" path = "crates/draw/src/ui/artboard/stories.rs" reason = "The artboard background is document data in a story, not a UI colour." count = 2 + +[[exception]] +name = "convert-point-cursor-tip" +kind = "marker" +rule = "literal-size/vec2" +path = "crates/draw/src/ui/pen/anchor_tool.rs" +reason = "The cursor art's hot spot offset is in icon units, not a layout size." +count = 1 diff --git a/design/exceptions/craft-print/crate.toml b/design/exceptions/craft-print/crate.toml index 88f56e78b..aa4a9c243 100644 --- a/design/exceptions/craft-print/crate.toml +++ b/design/exceptions/craft-print/crate.toml @@ -1 +1,17 @@ config_version = 1 + +[[exception]] +name = "print-marks-geometry" +kind = "marker" +rule = "literal-size/vec2" +path = "crates/print/src/ui/dialog.rs" +reason = "Printer's marks are page geometry in points, not UI sizes." +count = 4 + +[[exception]] +name = "print-story-page-sizes" +kind = "marker" +rule = "literal-size/vec2" +path = "crates/print/src/ui/stories.rs" +reason = "Page and paper sizes are document points, story data." +count = 4 diff --git a/design/exceptions/craft-ui-patterns/form_dialogs.toml b/design/exceptions/craft-ui-patterns/form_dialogs.toml index 88f56e78b..ef980dcff 100644 --- a/design/exceptions/craft-ui-patterns/form_dialogs.toml +++ b/design/exceptions/craft-ui-patterns/form_dialogs.toml @@ -1 +1,9 @@ config_version = 1 + +[[exception]] +name = "slice-number-inset" +kind = "marker" +rule = "literal-size/vec2" +path = "crates/ui-patterns/src/patterns/form_dialogs/save_for_web/panes.rs" +reason = "The slice number sits a fixed 2 points inside the slice outline drawn over the image preview, which scales with the image, not the interface." +count = 1