PR10 of ck-diagram: edge selection, label editing, color picker #57
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/057-pr10-of-ck-diagram-edge-selection-label-editin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR10 of ck-diagram: edge selection, label editing, color picker
Along the way:
Touches 21 files:
Cargo.lock,ck-diagram/Cargo.toml,ck-diagram/src/canvas.rs,ck-diagram/src/export.rs,ck-diagram/src/history.rs,ck-diagram/src/lib.rsand 15 more.A clear improvement. The change in
ck-diagram/src/export.rsis the part I would have argued for.@ -0,0 +575,4 @@/// Format an `f32` for the SVG attribute stream — three decimals,/// trailing zeros trimmed, so the output is compact without slipping/// into scientific notation on extreme values.fn fmt(v: f32) -> String {fmtreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?@ -5091,0 +5246,4 @@});view.cycle_edge_routing(&mut diagram);assert!(matches!(diagram.edges.iter().find(|e| e.id == edge_id).unwrap().routing,iterunwraps here. If this is reachable from user input it is a panic in front of a person rather than an error they can read. Is it provably there at this point, or should it carry a??@ -0,0 +626,4 @@let svg = to_svg(&d);let opts = usvg::Options::default();usvg::Tree::from_str(&svg, &opts).expect("complex svg parses");The expect message on
usvgis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?Split. The decision in
fmtis a pure function now, with its own tests inck-diagram/src/export.rs.It is reachable. The function in
ck-diagram/tests/canvas.rsreturns a Result now and the caller reports it, so the unwrap oniteris gone.It said what I assumed. Reworded in
ck-diagram/tests/export.rsso it names the input that broke it, which is what the bug report will need.Read it too. No objection to
ck-diagram/src/export.rs.