Tests: the task bar follows an edit and Undo

The task bar drops Join once the selected open path is closed and offers it
again after Undo, and Shape Properties shows a rectangle's corner radius as
it is after object.setLiveShape and after Undo. The progress line names the
new test.
This commit is contained in:
dotCooCoo
2026-11-05 10:54:45 +07:00
committed by bflatastic
parent c236129702
commit 8a5ec6a25f
2 changed files with 31 additions and 1 deletions
+30
View File
@@ -444,3 +444,33 @@ fn the_task_bar_follows_the_active_document() {
assert!(has(&texts, "Rectangle Properties:"), "{texts:?}");
assert!(!locked(&app, rect), "the button doesn't lock the shape");
}
/// The task bar shows the selection as it is after an edit and after Undo: Join leaves once the
/// open path is closed and comes back with Undo, and Shape Properties shows a rectangle's new
/// corner radius and then its old one.
#[test]
fn the_task_bar_follows_edits_and_undo() {
let mut app = app();
app.run("tool.select", json!({"tool": "selection"})).unwrap();
let line = id(app.run("shape.line", json!({"x1": 50, "y1": 50, "x2": 200, "y2": 120})).unwrap());
select(&mut app, &[line]);
assert!(has(&bar(&mut app).1, "Join"));
app.run("path.join", json!({})).unwrap();
let (_, texts) = bar(&mut app);
assert!(!has(&texts, "Join"), "{texts:?}");
app.run("edit.undo", json!({})).unwrap();
let (_, texts) = bar(&mut app);
assert!(has(&texts, "Join"), "{texts:?}");
let rect = id(app.run("shape.rectangle", json!({"x": 40, "y": 40, "width": 80, "height": 60, "radius": 10})).unwrap());
select(&mut app, &[rect]);
let (_, texts) = click_lock_slot(&mut app);
assert!(has(&texts, "10 pt") && !has(&texts, "20 pt"), "{texts:?}");
app.run("object.setLiveShape", json!({"radius": 20})).unwrap();
let (_, texts) = click_lock_slot(&mut app);
assert!(has(&texts, "20 pt") && !has(&texts, "10 pt"), "{texts:?}");
app.run("edit.undo", json!({})).unwrap();
let (_, texts) = click_lock_slot(&mut app);
assert!(has(&texts, "10 pt") && !has(&texts, "20 pt"), "{texts:?}");
assert!(!locked(&app, rect), "the button doesn't lock the shape");
}
+1 -1
View File
@@ -1314,7 +1314,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Live objects in documents with many symbols:** a live object, or an object with effects, that shows symbols or patterns is not walked again in a later frame to find them while the document's symbols and patterns stay the same. One that shows a placed file is walked in every frame. At 1000 × 1000 pixels, a page of 2,000 envelopes around instances of the last 2,000 of 10,000 symbols takes 30 ms a frame, and 83 ms when every frame walks them again, with the same pixels.
- **Control bar and task bar on large paths:** the Control bar and the contextual task bar read the first selected object in place each frame instead of copying it; the task bar copies the object only when it is a basic shape, for its Shape Properties. With one selected open path of 200,000 anchors, an idle frame with both bars shown takes 3.8 ms in a release build instead of 8.0 ms (medians of five interleaved runs). Tests: `the_control_bar_label_follows_edits_undo_documents_and_selection`, `the_task_bar_follows_the_active_document`.
- **Control bar and task bar on large paths:** the Control bar and the contextual task bar read the first selected object in place each frame instead of copying it; the task bar copies the object only when it is a basic shape, for its Shape Properties. With one selected open path of 200,000 anchors, an idle frame with both bars shown takes 3.8 ms in a release build instead of 8.0 ms (medians of five interleaved runs). Tests: `the_control_bar_label_follows_edits_undo_documents_and_selection`, `the_task_bar_follows_the_active_document`, `the_task_bar_follows_edits_and_undo`.
- **Type drawn as glyph outlines:** under a geometry effect, in EMF and WMF export, in DXF export when it is written as outlines, flattened with Convert All Text to Outlines, and inside an envelope, type keeps its underline and strikethrough, the weight and dashes of its character strokes when it is scaled, and the placement of its gradients and patterns, as the canvas draws it. A group's or layer's own fills and strokes also paint the underline and strikethrough of the type in it.