fix: smooth freehand stroke capture - #585
Merged
Merged
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "fix: retain short wide stroke endpoints" | Re-trigger Greptile |
vibhavkatre
approved these changes
Sep 1, 2026
vibhavkatre
left a comment
Collaborator
There was a problem hiding this comment.
Sound, and the endpoint guard is the part that makes it safe. Notes from checking it:
finishStrokehas exactly one caller (useWhiteboardInteraction.js:226), soappendStrokeEndpointcan never be handed anundefinedendpoint.- Sparser anchors do not make strokes look angular, because
smoothPathdraws one quadratic per point through the midpoints — wider spacing rounds the curve rather than faceting it, which is the direction #574 asks for. - Width-proportional thinning is the right instinct. At the widest highlighter (26) the threshold reaches ~19.5 canvas units, which is coarse in absolute terms; the smoothing hides it for ordinary highlighting, but if a tight highlighter curve ever reads as clipped, that ratio is the dial. Worth remembering it is measured in canvas units, so drawing zoomed in thins more aggressively than drawing at 100%.
Merging.
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.
Closes #574
What changed
Freehand capture now keeps a more useful distance between stored anchors, with a wider threshold for wider ink. The committed-path rendering contract is unchanged.
Why it matters
Slow strokes retain their intended shape while filtering the dense, low-amplitude samples that make them look mechanical.
Verified
Closes #574.