Skip to content

Raise the desktop minPointDistance default to 4 dp - #31

Merged
sproctor merged 1 commit into
masterfrom
feat/desktop-min-distance-4dp
Oct 16, 2026
Merged

sproctor merged 1 commit into
masterfrom
feat/desktop-min-distance-4dp

Conversation

@sproctor

@sproctor sproctor commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Why

#28 added minPointDistance with a 2.dp default on desktop, where AWT reports the mouse in whole pixels. A rendered comparison of a slow whole-pixel signature at 2 to 6 dp showed 2.dp still visibly wobbly, with the wobble fading by 4.dp and small loops keeping their shape. This commit was pushed to #28's branch after it merged, so it didn't make it in.

What

  • SignaturePadDefaults.minPointDistance is 4.dp on the JVM. Android, iOS and web stay at 0.dp.
  • The KDoc, README and CLAUDE.md say 4.dp. The README's example uses 6.dp, so it doesn't look like the default.
  • CLAUDE.md had a sentence about edge crossings twice; one is removed.

Testing

  • MinPointDistanceTest.theDefaultOnDesktop_is4Dp checks the new default. The other filter tests pass explicit distances and are unchanged.
  • :signaturepad:allTests (JVM, JS, Wasm), :signaturepad:build, :demo:assemble and :androidDemo:assembleDebug pass. The 95 JVM tests include the existing ones that draw on the pad with the default. iOS tests run in CI.
  • The comparison used generated input at density 1. It hasn't been tried with a real mouse in the desktop demo.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • Increased the default minimum distance between signature points on desktop from 2.dp to 4.dp. Other platforms retain the 0.dp default.
    • Updated the documentation to reflect the desktop default.

At 2.dp, a slow mouse stroke through whole pixels still came out
visibly wobbly. A rendered comparison of 2 to 6 dp showed the wobble
fading by 4.dp, without losing the shape of small loops.

Also removes a sentence CLAUDE.md had twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 489e2f03-cecf-46ad-a67e-03393a741bf2
📥 Commits

Reviewing files that changed from the base of the PR and between b1e2a86 and a67c284.

📒 Files selected for processing: 5
  • CLAUDE.md
  • README.md
  • signaturepad/src/commonMain/kotlin/com/seanproctor/signaturepad/SignaturePadDefaults.kt
  • signaturepad/src/jvmMain/kotlin/com/seanproctor/signaturepad/SignaturePadDefaults.jvm.kt
  • signaturepad/src/jvmTest/kotlin/com/seanproctor/signaturepad/MinPointDistanceTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The JVM default minPointDistance changes from 2.dp to 4.dp. The test and documentation are updated to reflect the new default. The README example changes its explicit value from 4.dp to 6.dp.

Changes: JVM minimum point distance

Layer / File(s) Summary
Update JVM default and references
signaturepad/src/commonMain/kotlin/com/seanproctor/signaturepad/SignaturePadDefaults.kt, signaturepad/src/jvmMain/kotlin/com/seanproctor/signaturepad/SignaturePadDefaults.jvm.kt, signaturepad/src/jvmTest/kotlin/com/seanproctor/signaturepad/MinPointDistanceTest.kt, README.md, CLAUDE.md
The JVM default and its documented value change to 4.dp. The test expects 4.dp. The README example changes to 6.dp and retains 0.dp as the default on other platforms. CLAUDE.md removes a duplicate sentence about moves crossing the pad’s edge.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: bayram-mkinini

Merge Risk: ⚪ Minimal · up to a67c2

The desktop default is now 4.dp, with the documentation and default-value test updated accordingly. Real-mouse behavior has not been evaluated, but the supplied evidence identifies no concrete regression or remaining merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: increasing the desktop minPointDistance default to 4 dp.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sproctor
sproctor merged commit 208dd53 into master Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant