View: no guide from the rulers while Trim View is on (#8363)

Trim View hides the guides, so a guide dragged or double-clicked out of a
ruler while it is on was made but could not be seen, and the drag turned
the stored Show Guides choice on. Now neither makes a guide: no preview
line, no undo step, the stored choice is left alone, and the status line
says why. A drag already going when Trim View turns on ends as a release
off the canvas does.
This commit is contained in:
HassanKhan committed 2026-11-19 19:42:22 +05:00
1 parent 40f1201f1e
commit fb7d601fea
8 files changed
+110 -8

No files matched your search

+6
View File
@@ -839,6 +839,12 @@ impl Session {
self.ruler_origin = None;
}
/// A guide is being dragged out of a ruler ([`Session::ruler_guide`]): its first event came
/// and its release has not.
pub fn ruler_guide_dragging(&self) -> bool {
self.ruler_guide.is_some()
}
/// Time passed while the pointer button is held (`dt` seconds; see [`Tool::tick`]): the
/// desktop app ticks every frame of a press, agents with `holdMs` on a pointer event.
pub fn tool_tick(&mut self, dt: f64, view: ViewInfo) -> Result<Vec<UiRequest>> {
+20 -2
View File
@@ -222,7 +222,14 @@ pub(super) fn ruler_input(app: &mut VectorcraftApp, ui: &Ui, full: egui::Rect, c
if resp.clicked_by(egui::PointerButton::Primary) {
ui.data_mut(|d| d.insert_temp(last_click, now));
}
if resp.double_clicked_by(egui::PointerButton::Primary)
// Trim View hides the guides (#8363): a guide made now could not be seen, so none is.
let trim_view = app.ui.view.trim_view;
let refuse = |app: &mut VectorcraftApp| app.status(crate::menus::TRIM_VIEW_HIDES.to_string());
if trim_view && first_here && resp.double_clicked_by(egui::PointerButton::Primary) {
refuse(app);
}
if !trim_view
&& resp.double_clicked_by(egui::PointerButton::Primary)
&& first_here
&& let Some(p) = resp.interact_pointer_pos().or_else(|| ui.input(|i| i.pointer.latest_pos()))
{
@@ -253,8 +260,19 @@ pub(super) fn ruler_input(app: &mut VectorcraftApp, ui: &Ui, full: egui::Rect, c
} else {
continue;
};
if trim_view {
if resp.drag_started() {
refuse(app);
}
// No guide is dragged out, so none previews. One already dragged when Trim View
// turned on ends as a release off the canvas does: no guide, no undo step.
if !app.session.ruler_guide_dragging() {
continue;
}
}
let kind = if trim_view { PointerKind::Up } else { kind };
let p = resp.interact_pointer_pos().or_else(|| ui.input(|i| i.pointer.latest_pos()));
let on_canvas = p.is_some_and(|p| canvas.contains(p));
let on_canvas = !trim_view && p.is_some_and(|p| canvas.contains(p));
if on_canvas {
// The new guide shows even if guides were hidden.
app.ui.view.guides = true;
+77
View File
@@ -15344,3 +15344,80 @@ fn trim_view_deselects_selected_guide_paths() {
assert!(app.session.active().unwrap().selection.objects.is_empty());
}
/// #8363: Trim View hides the guides, so a guide dragged or double-clicked out of a ruler while it
/// is on would be made but never seen. None is: no preview line, no guide, no undo step, the
/// stored Show/Hide Guides choice is left alone, and the status line says why. A drag already
/// going when Trim View turns on ends as a release off the canvas does.
#[test]
fn trim_view_makes_no_guide_from_the_rulers() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
app.ui.view.rulers = true;
app.ui.view.guides = false;
app.ui.view.smart_guides = false;
app.ui.view.snap_to_point = false;
app.ui.view.trim_view = true;
let ctx = egui::Context::default();
frame(&mut app, &ctx, vec![]);
let rect = app.canvas_rect.unwrap();
let from = pos2(rect.center().x, rect.top() - RULER / 2.0);
let at = pos2(rect.center().x, rect.top() + 120.0);
let button = |pos, pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
let across = |s: &Shape| {
matches!(s, Shape::LineSegment { points, .. }
if (points[0].y - at.y).abs() <= 2.0 && points[0].y == points[1].y && (points[1].x - points[0].x).abs() >= rect.width() - 0.5)
};
let count = |app: &VectorcraftApp| app.session.active().unwrap().doc.ruler_guides().len();
let steps = |app: &VectorcraftApp| app.session.active().unwrap().history.undo.len();
let before = steps(&app);
// A drag: nothing previews and nothing is made.
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]);
frame(&mut app, &ctx, vec![button(from, true)]);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at)]);
assert!(!shapes(&mut app, &ctx).iter().any(across), "no guide previews");
assert!(!app.session.ruler_guide_dragging());
frame(&mut app, &ctx, vec![button(at, false)]);
assert_eq!(count(&app), 0, "no guide from a drag");
assert!(!app.ui.view.guides, "the stored choice is left alone");
assert_eq!(app.ui.status, crate::menus::TRIM_VIEW_HIDES);
// A double-click: nothing either.
app.ui.status.clear();
let click = |app: &mut VectorcraftApp| {
frame(app, &ctx, vec![egui::Event::PointerMoved(from)]);
frame(app, &ctx, vec![button(from, true)]);
frame(app, &ctx, vec![button(from, false)]);
};
click(&mut app);
click(&mut app);
assert_eq!(count(&app), 0, "no guide from a double-click");
assert!(!app.ui.view.guides);
assert_eq!(app.ui.status, crate::menus::TRIM_VIEW_HIDES);
assert_eq!(steps(&app), before, "no undo step");
// Trim View turned on during a drag: the drag ends without a guide.
app.ui.view.trim_view = false;
let from2 = pos2(rect.center().x + 30.0, rect.top() - RULER / 2.0);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(from2)]);
frame(&mut app, &ctx, vec![button(from2, true)]);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at)]);
assert!(app.session.ruler_guide_dragging(), "the drag started with Trim View off");
app.ui.view.trim_view = true;
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(pos2(at.x + 5.0, at.y))]);
assert!(!app.session.ruler_guide_dragging(), "ended");
assert!(!shapes(&mut app, &ctx).iter().any(across), "no guide previews");
frame(&mut app, &ctx, vec![button(at, false)]);
assert_eq!(count(&app), 0, "no guide from the drag Trim View interrupted");
assert_eq!(steps(&app), before, "no undo step");
// With Trim View off again, a drag makes a guide as before.
app.ui.view.trim_view = false;
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]);
frame(&mut app, &ctx, vec![button(from, true)]);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at)]);
frame(&mut app, &ctx, vec![button(at, false)]);
assert_eq!(count(&app), 1);
assert!(app.ui.view.guides, "the new guide shows");
}
+1
View File
@@ -49,6 +49,7 @@ mod invoke;
mod keyboard;
mod labels;
mod run;
pub(crate) use run::TRIM_VIEW_HIDES;
mod slots;
mod state;
mod submenus;
+1 -1
View File
@@ -136,7 +136,7 @@ pub fn run_ui_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<R
}
/// Why Show/Hide Guides and Show/Hide Grid refuse to run while Trim View is on.
const TRIM_VIEW_HIDES: &str = "Trim View hides the guides and the grid; turn it off first";
pub(crate) const TRIM_VIEW_HIDES: &str = "Trim View hides the guides and the grid; turn it off first";
/// Drops the selection when it holds ruler guides or guide paths that no longer draw (Hide Guides,
/// Trim View): their selection overlay would otherwise reveal the geometry just hidden.
+1 -1
View File
@@ -232,7 +232,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | M11: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid (#8363). Scores and estimates unchanged |
| 2026-11-19 | minor | M11: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged |
| 2026-11-18 | minor | M10/G5: Media Controls joins Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons and Weather Icons as a seventh built-in symbol library (Play, Pause, Stop, Skip Next, Shuffle, Repeat; original procedural vector symbols generated in code, no default 9-slice); G5 estimate decremented to 2–12 h, milestone estimates unchanged |
| 2026-11-18 | minor | M7/G4: Retype phase 1 (#4934): `type.retype` turns outlined text that exactly matches an available font back into point text. Scores and estimates unchanged |
| 2026-11-18 | minor | M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538). Scores and estimates unchanged. |
+2 -2
View File
@@ -626,7 +626,7 @@ since 2026-10-01.
- **Blend redraw bounds (#5179):** renderer bounds include the reach of keys and steps rotated along a curved spine, so changed pixels remain inside the advertised redraw area. The original straight-blend control and curved Replace Spine, move and Undo regressions are in `crates/engine/tests/blend_render_consistency.rs`; both focused CPU cases pass. This is a redraw-bounds correction. Scores and hours unchanged.
- **Guide row highlight (#7344):** `guide_row_highlight_stays_selected_without_hover` in `crates/ui-egui/src/panels/layers/tests.rs` checks selected guide background after the pointer leaves, with unselected guide and ordinary row controls. Guide selection, dragging and deletion are unchanged. Scores and estimates unchanged.
- **Trim View hides guides and the grid (#8363):** while View › Trim View is on, the canvas and tiled panes draw no ruler guides, no guide paths and no grid, the guides are neither snapped to nor picked, and Show/Hide Guides and Show/Hide Grid are greyed out (menu bar, canvas context menu, Properties) and refuse to run; the stored choices come back when it is turned off, and the rulers stay ([trim view hides guides](https://community.adobe.com/t5/illustrator-discussions/trim-view-hides-guides/td-p/14066140), [guides greyed out](https://community.adobe.com/t5/illustrator-discussions/guides-greyed-out/m-p/11132728)). `trim_view_hides_the_guides_and_the_grid`, `trim_view_deselects_selected_guide_paths` in `crates/ui-egui/src/canvas/tests.rs`; `trim_view_greys_out_show_guides_and_show_grid` in `crates/ui-egui/src/menus/tests.rs`.
- **Trim View hides guides and the grid (#8363):** while View › Trim View is on, the canvas and tiled panes draw no ruler guides, no guide paths and no grid, the guides are neither snapped to nor picked, and Show/Hide Guides and Show/Hide Grid are greyed out (menu bar, canvas context menu, Properties) and refuse to run; the stored choices come back when it is turned off, and the rulers stay ([trim view hides guides](https://community.adobe.com/t5/illustrator-discussions/trim-view-hides-guides/td-p/14066140), [guides greyed out](https://community.adobe.com/t5/illustrator-discussions/guides-greyed-out/m-p/11132728)). A drag or double-click on a ruler makes no guide while it is on (no preview, no undo step, a status message). `trim_view_hides_the_guides_and_the_grid`, `trim_view_deselects_selected_guide_paths`, `trim_view_makes_no_guide_from_the_rulers` in `crates/ui-egui/src/canvas/tests.rs`; `trim_view_greys_out_show_guides_and_show_grid` in `crates/ui-egui/src/menus/tests.rs`.
- **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged.
@@ -3080,7 +3080,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items (#8363). Scores and estimates unchanged. |
| 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged. |
| 2026-11-18 | minor | Layers panel: context menu on guide rows (Release Guide, Duplicate, Delete Guide, Lock/Unlock, Hide/Show) with one-step undo; regression tests in `crates/ui-egui/src/panels/layers/tests.rs`; scores and estimates unchanged. |
| 2026-11-18 | minor | Type advanced: Retype phase 1 (`type.retype`, #4934), exact matches of available fonts become point text again; evidence added; near matches, the ranked font list and images remain; score and hours unchanged |
| 2026-11-18 | minor | Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538). Scores and estimates unchanged. |
+2 -2
View File
@@ -295,7 +295,7 @@ tools, never checked side by side) isn't captured row by row.
| Ruler origin: corner drag with preview, snapped as a drawn point is (Smart Guides, Snap to Point and the ruler guides, pixels, the grid), double-click reset to the active artboard, relative X/Y fields, native save/reopen | done | #1212; `document.setRulerOrigin`, `document.resetRulerOrigin`; geometry and command coordinates stay absolute |
| Ruler guides as Layers rows: shown, hidden, locked and deleted with their layer; rows dragged to another layer; each row's own eye and lock; a row dropped on the trash deletes its guide; selected guide rows keep their highlight away from the pointer (#7344); a plain click on another row lets go of the guide | done | `guide.setLayer`; guides from older files go on a layer; `layer.setProps` on a guide's id hides or locks it alone; Object › Lock/Hide › Selection, Unlock All and Show All reach guides; `guide.remove {indexes}`; #7340 |
| Objects made into guides: drawn in the guide colour and style of Preferences; Lock Guides locks them too (no select, move or delete), in groups as well: a marquee leaves them out, so it does not take their group, and they still move with their group; a dragged selection snaps to ruler guides with Smart Guides on, by the nearest point of the path when pressed on its stroke or beside its edge, so the path lands exactly on the guide | done | #1534 (#1543, #1583); #3701; #8538 |
| View › Trim View hides the ruler guides, the guide paths and the grid while it is on, and View › Guides › Show/Hide Guides and View › Show/Hide Grid are greyed out until it is off (#8363) | done | As public forum threads describe ([trim view hides guides](https://community.adobe.com/t5/illustrator-discussions/trim-view-hides-guides/td-p/14066140), [guides greyed out](https://community.adobe.com/t5/illustrator-discussions/guides-greyed-out/m-p/11132728)). The Show/Hide choices are kept and come back as they were; the items stay greyed in the canvas context menu and the Properties panel's buttons, and refuse to run from keys, the palette or MCP. Hidden guides are neither snapped to nor picked, as with Hide Guides, and a selected guide path is deselected. The rulers stay as they are. `menus::tests::trim_view_greys_out_show_guides_and_show_grid`, `canvas::tests::{trim_view_hides_the_guides_and_the_grid, trim_view_deselects_selected_guide_paths}` |
| View › Trim View hides the ruler guides, the guide paths and the grid while it is on, and View › Guides › Show/Hide Guides and View › Show/Hide Grid are greyed out until it is off (#8363) | done | As public forum threads describe ([trim view hides guides](https://community.adobe.com/t5/illustrator-discussions/trim-view-hides-guides/td-p/14066140), [guides greyed out](https://community.adobe.com/t5/illustrator-discussions/guides-greyed-out/m-p/11132728)). The Show/Hide choices are kept and come back as they were; the items stay greyed in the canvas context menu and the Properties panel's buttons, and refuse to run from keys, the palette or MCP. Hidden guides are neither snapped to nor picked, as with Hide Guides, and a selected guide path is deselected. The rulers stay as they are, but a drag or double-click on them makes no guide, since it could not be seen: no preview line, no undo step, a status message instead. `menus::tests::trim_view_greys_out_show_guides_and_show_grid`, `canvas::tests::{trim_view_hides_the_guides_and_the_grid, trim_view_deselects_selected_guide_paths, trim_view_makes_no_guide_from_the_rulers}` |
| A selected ruler guide's X or Y in the Transform panel; typing a value moves it | not scored | #1659 (part of #1597); several guides move together; not in Properties or the Control bar. Not established by the documentation we could find: the help pages on guides, rulers and the Transform, Control and Properties panels (read again on 2026-10-14) don't describe it, and the one public statement is a user's [community answer](https://community.adobe.com/questions-652/adding-a-new-custom-guide-785586), which is not documentation. Kept as a convenience pending the owner's decision; no parity claim |
| Alt swaps a ruler guide's orientation while dragging | missing | Alt-drag copies the selected guides ([Use rulers](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/use-rulers.html)); `guide.move` `{copy: true}` |
| Alt swaps a new ruler guide's orientation while dragging | done | Both rulers; preview, snapping and final placement follow the current modifier ([public shortcut reference](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html)). |
@@ -617,7 +617,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid until it is off; the choices come back as they were and the rulers stay (#8363). Scores and estimates unchanged. |
| 2026-11-19 | minor | View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid until it is off; the choices come back as they were and the rulers stay, though dragging or double-clicking them makes no guide meanwhile (#8363). Scores and estimates unchanged. |
| 2026-11-19 | minor | G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s (part of #5930, `file.cancelPlace`); indeterminate moving bar, Cancel (Esc) leaves the document unmodified without undo steps; scores and estimates unchanged. |
| 2026-11-18 | minor | Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538). Scores and estimates unchanged. |
| 2026-11-18 | minor | Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged. See [production-preflight.md](production-preflight.md) for scope and limits. |