Repository navigation
Conversation
While the Smooth tool is in use with a path it can smooth selected, the bar shows the tool's Fidelity field and Tool Options..., which opens the Smooth tool's options. The field sets Fidelity through tool.setOption with the same range, unit and steps as the field in the options dialog. With nothing smoothable selected, the tool shows no bar. The bar leaves out the selection tools' actions and the Fill, Stroke, Recolor Artwork and Lock controls. On a canvas too narrow for the field, More Options lists Fidelity, which opens the tool's options. The Smooth tool's cursor and the bar share one check of the selection, which the bar keeps for the document's revision.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 seconds. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
What and why
The contextual task bar did not show while the Smooth tool was in use, even with a path selected. The bar's overview page lists the Smooth tool among the tools for which the bar shows that tool's options (Contextual Task Bar overview), and the Smooth tool's help page describes one option, Fidelity, which sets how many anchor points the tool adds to a path (Smooth tool). Neither page lists the bar's items or their order, so the items below are VectorCraft's own rules.
tool.options).tool.setOption.crates/ui-egui/src/dialogs/freehand.rsnow hasfidelity_fieldandfidelity_unithelpers that both the dialog and the bar use, so the bar's field has the same range, unit (screen pixels) and steps as the field in the options.can_smooth(crates/tools/src/draw2/gesture.rs) holds the check the Smooth tool's cursor already made, and the bar uses the same function. The bar keeps its answer for the document's revision, so it does not walk the selection on every frame.crates/ui-egui/src/canvas/task_bar.rs, with no change to what they draw.docs/target-app-parity.mdhas one line for the Smooth tool's bar, and its handle line now names the Smooth tool among the tools that show the bar. No command or user-visible string was added.How it was tested
New tests in
crates/ui-egui/src/tests/taskbar.rs, each failing without the change:the_smooth_tool_shows_fidelity_and_tool_options_for_a_path: with an ellipse selected and the Smooth tool in use, the bar has Tool Options… and More Options and none of Fill, Stroke, Recolor Artwork, Lock, Duplicate, Edit Path, Offset Path, Simplify or Smooth. Typing 7 in the Fidelity field sets the tool'sfidelityto 7 and keeps the tool and the selection, and Tool Options… opens the Smooth tool's options with 7.the_smooth_tool_shows_no_bar_without_a_path_to_smooth: no bar with nothing, a straight line or type selected; a bar with Fidelity for a path and a line together; on one canvas the bar follows each change of the selection; with the Selection tool the bar shows Duplicate and no Fidelity.The branch is one commit on
mainat8f339eeaa1, andmainhad not moved when this was posted. Checks on the final tree:mainat that commit does not build (crates/trace/src/seam.rs:87), so these ran with the one-line fix from #7831 applied to that file:cargo fmt --all -- --checkcargo clippy -p vectorcraft-tools --all-targets -- -D warningsandcargo clippy -p vectorcraft-ui-egui --all-targets -- -D warningscargo check --workspace --testscargo test -p vectorcraft-ui-egui --lib taskbar::: 40 passedcargo test -p vectorcraft-ui-egui --lib dialogs::freehand: 15 passedcargo test -p vectorcraft-tools --lib smooth: 26 passedcargo xtask brands,layersandassetscargo xtask ciruns in this pull request's CI.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.Summary by CodeRabbit