Repository navigation
Draw tab: live stroke preview uses the selected pen's colour and thickness - #1793
alosslessdev wants to merge 1 commit into
Conversation
Round-trip test: Excel 16.0 (Build 20430) ↔ GridCraft @ 7b3d09eResult: this PR's preview change is fine, but Excel pen strokes do not round-trip through main's XLSX reader. An existing PR already owns that fix, so I stopped before opening a duplicate. What Excel writesA 0.35 mm red pen stroke drawn with Excel's Draw tab (blank workbook,
Excel → GridCraft
"images": 1,
"shapes": 0The stroke is imported from the fallback PNG as a picture, not as editable ink, so Ink to Shape cannot act on it. Saving from GridCraft writes the picture back; Excel reopens a picture, not ink. GridCraft → Excel
Duplicate#1187 ("Draw: typed ink, Excel InkML and Draw with Trackpad") already implements this: This PR
I stopped before the all-pens/eraser matrix because #1187 already owns the InkML work. |
Fixes #1786.
The Draw tab's live stroke preview now uses the selected pen's colour and thickness, so the line under the pointer is the ink that will be committed — the highlighter preview is a thick yellow line, not a thin blue one.
What changed
crates/ui-egui/src/grid.rs: the in-progress stroke is painted withsession.draw_colorandsession.draw_width(falling back to 2 pt when no width has been set).ink_color: parses#RRGGBBinto a painter colour, defaulting to pen blue on bad input; no panics.crates/ui-egui/tests/draw_preview.rs) drives a pointer drag with a red 8 pt pen and asserts the painted path carries exactly that colour and width.Control order, labels and menus are unchanged; they are separate PRs (#1783, #1784, #1785). Cut from
main, independent of #1767/#1187.Verification
cargo fmt --all -- --checkcargo clippy -p gridcraft-ui-egui --all-targets -- -D warningscargo test -p gridcraft-ui-egui(full crate suite, including the new preview test)docs/ui-parity.mdrevision history updated;contributors/people.tomlentry perAGENTS.md