Skip to content

Add a Saver implementation (with resize feature to support it)#8

Merged
sproctor merged 2 commits into
masterfrom
feat/resize
Jun 8, 2026
Merged

Add a Saver implementation (with resize feature to support it)#8
sproctor merged 2 commits into
masterfrom
feat/resize

Conversation

@sproctor

@sproctor sproctor commented Jun 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

sproctor and others added 2 commits June 8, 2026 16:25
Resizing the pad previously always cleared the signature. SignaturePadState
now takes a ResizeBehavior controlling how an in-progress signature is
remapped: Clear (default), Center, Fit, Stretch, or a per-point Custom mapper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes #2. SignaturePadStateImpl is not Parcelable/Serializable, so it could
not survive configuration changes (e.g. orientation) out of the box.

Add a SignaturePadStateSaver factory that flattens the signature (pad size,
started flag, and each bezier's source points) to a List<Float>, and a new
rememberSaveableSignaturePadState that uses rememberSaveable to preserve the
signature. rememberSignaturePadState is left unchanged. The resize behavior is
supplied to the saver rather than serialized, since Custom may hold a
non-serializable lambda.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sproctor sproctor merged commit b413e17 into master Jun 8, 2026
1 check 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