Repository navigation
fix(ink): keep smoothed ink inside export and selection bounds - #234
Merged
DWAA1660 merged 2 commits intoNov 14, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Smoothed ink could extend beyond its raw readings, while
Stroke::boundsonly enclosed those readings. This put selection handles inside visible ink and let the saved SVG viewport crop a curve. In the four-reading reproduction, the outline reaches y-15.57but the exported viewport begins at-2. The real SVG rasterizer confirms clipped pixels in both Plain and Editable exports.Stroke::boundsnow unions the original extrema with the same sampled centreline used by the painter and SVG outline. It retains the selected full-width padding, existing sheet area, and unchanged dot/two-reading behavior.Drawing::add, drawing bounds and selection bounds inherit the correction. Stored readings and pressure are unchanged. No renderer or hit-test code changes.Fixes #231. This is separate from the cap-angle fix #218 and pressure-aware hit testing #230.
Validation
cargo test -p notecraft-ink: 42 existing tests and 3 new regressions passed. Cases cover rotation, reversal, all tools, pressure, full-width padding, existing sheet area, selection bounds and stable Editable rereading.cargo test -p notecraft-ui-egui --test ink_svg_bounds: passed. It uses the existing SVG loader for real Plain/Editable exports, with an expanded-viewport control whose paths and readings are identical.cargo xtask demoandcargo xtask demo-check: passed; generation produced no tracked notebook changes, and all 662 generated files match the source.cargo test -p notecraft-formats --test format_parity: 3 passed.Hosted platform, coverage and WASM results will be reported by CI. No new dependencies or test doubles were added.
The normal pre-push gate completed successfully: cargo xtask ci reported all checks passed.