Repository navigation
Draw a signature field's box, and keep a mark once it's in - #982
Merged
Merged
Conversation
A signature field's widget now draws its box: its background and border, in its style. Placing one writes it, and a restyle draws it again, so the colors the style panel offers show, instead of flashing and going back. The form painter draws the same box live. Once a mark is in the field (it's signed, or a mark was drawn in with forms.setSignatureAppearance), the widget reads hasMark: true and shows the mark. Its style no longer applies: a style change is refused with InvalidArg, a resize keeps the mark, and the viewer offers it as the widget-mark kind, which has no style rows. A mark drawn in records its fit as a stamp records its own. Needs the runtime with the fork's signature box (pinned separately).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The release brings fork PRs 113 and 114: a signature field's widget and a widget in no field draw their box (GenerateBoxFormAP, the /Sig and no-field branches of EPDFAnnot_GenerateFormFieldAP, and the bake on attach), and a comment's rich text reads over the reader's defaults (the engine reads a redact's overlay font from /DA since PR 978). No function is added; runtime-src moves to the pin.
This branch had an error being deployed
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.
What changes
A signature field's style panel offered a border colour, background, border width and style, but picking one made the field flicker and go back. The engine wrote
/MKand/BSand then had nothing to draw them with: the fork's form generator had no/Sigbranch, so a restyle reportedgeneration-unavailable, and the form painter skipped signature fields. The viewer drew the new style while the change was pending, then fell back to the engine's picture, which was empty.Now a signature field's widget draws its box in its style, like every other widget, in both places that draw it:
Once a mark is in the field, it shows the mark instead. That happens when the field is signed, or a mark was drawn in with
forms.setSignatureAppearance:hasMark: true.InvalidArg; the style it reads, sent back, is no change.widget-markkind, which has no style rows, so the style panel offers nothing that wouldn't show.By layer:
GenerateBoxFormAP, the/Sigand no-field branches, the bake on attach) and Zooming with Ctrl + mouse wheel #113 (a comment's rich text reads over the reader's defaults, safe since Read and write a markup annotation's comment as rich text #978). No function is added.hasMark, an engine field.WIDGET_STYLE_NAMESlists a widget's style fields. It lives in a zod-free module, so the runtime entry still reaches no zod.hasMark: a signature field's widget, with a value (signed) or a recorded fit.assertMarkKeepsItsLookrefuses a style change on a marked widget before anything is written./EMBD_Metadata/AppearanceFit, the key a stamp records its own in. The key's read and write move toappearanceFit.ts, shared by both. Signing records nothing: a signing changes no other key of its widget, and the signing analysis holds it to that.fieldBoxOps, the port of the fork'sWriteFieldBox, shared with the text field.widget-markkind;widgetKindOftakes the widget.api:sync. The TypeScript SDK'sWidgetAnnotationgainshasMark.Not in this PR:
Testing
Run on the branch with main merged in, against the pinned runtime's code (native and wasm, built from the same tree as 4346c5131):
signature-visual-fill.test.ts):regeneratedand drawn in the new colour;hasMark;hasMarkand refuses a style change too.design.integration.test.ts: a restyled signature field draws live by the painter, then is confirmed by the engine. A marked one iswidget-markwith no live drawing.