Per-statement marks for the print marks; exception entries for the vec2 allows; slice number inset allow

This commit is contained in:
aiongg
2026-11-16 14:02:50 +00:00
parent 3bce302286
commit fca840bcc5
5 changed files with 37 additions and 2 deletions
+4 -2
View File
@@ -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));
}
}
@@ -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);
+8
View File
@@ -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
+16
View File
@@ -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
@@ -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