mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 12:38:18 +00:00
Merge pull request #8676 from storytold/train/carry7373
Layers: keep selected guide rows highlighted (#7373)
This commit is contained in:
@@ -142,7 +142,9 @@ fn guide_row(ui: &mut Ui, view: &View, item: &Row, i: usize, out: &mut Out) {
|
||||
let Some(g) = view.ruler_guides.get(i) else { return };
|
||||
let selected = view.guides.contains(&i);
|
||||
let editable = view.doc.guide_editable(g);
|
||||
if editable && resp.hovered() {
|
||||
if selected {
|
||||
ui.painter().rect_filled(r, 0.0, t.row_selected);
|
||||
} else if editable && resp.hovered() {
|
||||
ui.painter().rect_filled(r, 0.0, t.hover.gamma_multiply(0.6));
|
||||
}
|
||||
ui.painter().line_segment([r.left_bottom(), r.right_bottom()], Stroke::new(1.0, t.input_border));
|
||||
|
||||
@@ -3212,6 +3212,35 @@ fn guide_rows_list_by_index_whatever_the_node_order() {
|
||||
assert_eq!(indexes, [2, 1, 0]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn guide_row_highlight_stays_selected_without_hover() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 200, "height": 200})).unwrap();
|
||||
let rect = NodeId(app.session.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 20, "height": 20})).unwrap()["id"].as_u64().unwrap());
|
||||
app.session.execute("guide.add", &json!({"vertical": true, "pos": 50})).unwrap();
|
||||
app.session.execute("select.none", &json!({})).unwrap();
|
||||
expand(&mut app, &json!({})).unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
let (circles, _) = frame(&mut app, &ctx, vec![], false);
|
||||
assert_eq!(circles.len(), 2); // Layer, rectangle; guide has no target circle.
|
||||
let guide = egui::pos2(150.0, (circles[0].y + circles[1].y) / 2.0);
|
||||
let ordinary = egui::pos2(150.0, circles[1].y);
|
||||
let highlighted_at = |app: &mut VectorcraftApp, at: egui::Pos2| {
|
||||
// Clear hover so a hover rectangle cannot satisfy selected-fill proof.
|
||||
let mut out = ctx.run_ui(egui::RawInput { events: vec![egui::Event::PointerGone], ..Default::default() }, |ui| show(app, ui));
|
||||
out.textures_delta.clear();
|
||||
let selected = Tokens::get(&ctx).row_selected;
|
||||
out.shapes.iter().any(|c| matches!(&c.shape, egui::Shape::Rect(r) if r.fill == selected && r.rect.contains(at) && r.rect.width() > 200.0))
|
||||
};
|
||||
assert!(!highlighted_at(&mut app, guide), "an unselected guide is not highlighted");
|
||||
click_with(&mut app, &ctx, guide, egui::Modifiers::NONE);
|
||||
assert_eq!(vectorcraft_engine::cmd::guide_indexes(&app.session.active().unwrap().doc, &app.session.active().unwrap().selection.guides), [0]);
|
||||
assert!(highlighted_at(&mut app, guide), "selected guide has the ordinary row fill without hover");
|
||||
click_with(&mut app, &ctx, ordinary, egui::Modifiers::NONE);
|
||||
assert_eq!(app.session.active().unwrap().highlighted_rows(), [rect]);
|
||||
assert!(highlighted_at(&mut app, ordinary), "ordinary row painting remains intact");
|
||||
}
|
||||
|
||||
/// Right-clicking a row that is not highlighted selects it.
|
||||
#[test]
|
||||
fn context_menu_right_click_selects_unselected_row() {
|
||||
|
||||
@@ -60,6 +60,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
| 2026-11-15 | minor | G12: Swatches item menus validated in all five views: 39 focused tests passed, regression fails without the menu hooks, rendered list/thumbnail layouts inspected, and fresh local deep CodeRabbit review found zero issues. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. Scores and estimates unchanged. |
|
||||
| 2026-11-14 | minor | G5: Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. |
|
||||
| 2026-11-14 | minor | G12: Layers panel row context menu (Options…, Duplicate, Delete, Lock Others/Show All/Hide Others/Unlock All, Locate Object, Collect for Export) with selection handling and undo tracking. Scores and estimates unchanged. |
|
||||
| 2026-11-13 | minor | Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged. |
|
||||
| 2026-11-13 | minor | PDF import: preserve Type 3 font text runs as named groups `<g>`, or as live text in `TextAs::Text` mode if `/ToUnicode` exists on non-colour fonts (`TextAs::Outlines` produces grouped outlines) (#6740); scores and estimates unchanged. |
|
||||
| 2026-11-08 | minor | #3380, deletion only: preserve gradient placement and exact surviving geometry; consume owned subpaths with a shared original-node snapshot; consolidate status/evidence and document command/helper contracts. Compound behavior and the existing M2 status entry are retained. Endpoint highlighting remains open; scores and estimates unchanged. |
|
||||
| 2026-11-07 | minor | #3380 (deletion only): independent surviving path objects; transformed appearance, stacking, selection, cubic handles and Undo/Redo covered by `delete_path_pieces`; compound semantics retained. Endpoint highlighting remains open; scores and estimates unchanged. |
|
||||
|
||||
+2
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user