Signature Pad 1.0.0 · changelog

Signature Pad changelog

All notable changes to this package are documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.0] - 2026-10-15

Added

  • SignaturePad (uGUI, Add Component > luanrobs > Signature Pad): a MaskableGraphic that the user signs in with a mouse, a finger or a stylus. Works under Screen Space Overlay, Screen Space Camera and World Space canvases. Clear, Undo, Redo and StopReplay can be wired to a Button's On Click () list. Optional Placeholder object shown while the pad is empty. UnityEvents OnStrokeStarted, OnStrokeEnded, OnChanged, OnReplayFinished.
  • SignaturePadElement (UI Toolkit, [UxmlElement]): the same pad from UXML (<Luanrobs.Signature.SignaturePadElement />) or from code, with UXML attributes for every setting, a built-in baseline and "Sign here" hint, and the USS classes luanrobs-signature-pad, __ink, __line, __hint.
  • ISignaturePad, implemented by both views: pen colour, minimum and maximum pen width, background colour, pen pressure on or off, read-only; Clear, Undo, Redo; state queries (IsEmpty, StrokeCount, Bounds, IsDrawing, IsReplaying, CanUndo, CanRedo); events StrokeStarted, StrokeEnded, Changed, ReplayFinished.
  • Ink: point filtering, cubic Bezier smoothing, width from the pointer speed, or from the pen pressure when a stylus reports it; a tap gives a round dot.
  • CPU rasteriser with anti-aliased edges and exact integer alpha blending. The on-screen texture is updated by dirty rectangles and capped by MaxTextureSize (default 2048). The image is computed from the stroke data on the CPU, not by the GPU; only the Built-in Render Pipeline was run.
  • Input through pointer events only (EventSystem for uGUI, panel events for UI Toolkit), so the pad works with the legacy Input Manager and with the Input System package and references neither. One pointer draws at a time.
  • SignatureData: an immutable signature with ToPng, ToTexture, ToSvg, ToJson, FromJson, TryFromJson, Fit and Validate. It needs no pad and no scene.
  • Exports with SignatureExportOptions: trimmed to the ink with padding (default) or the whole pad, scale in pixels per pad unit, transparent or coloured background, size cap. SVG with one filled path per stroke, so the varying width is kept.
  • JSON stroke data ("format":"luanrobs.signature", "version":1) with positions, timing and pen pressure, read back bit for bit. Invariant culture for every number.
  • Load, LoadJson and Replay with the recorded timing (speed and longest pause between strokes), on unscaled time.
  • SignatureValidationRules and SignatureValidationResult: tells a deliberate signature from a tap, a short swipe or a straight line, with thresholds relative to the pad size.
  • Editor: a grouped Inspector for SignaturePad (with stroke count, size, texture size and Clear / Undo / Redo buttons in Play mode); Tools > luanrobs > Signature Pad > Create Signature Pad (uGUI) and the same item in the GameObject menu, which add a pad with a baseline and a hint, plus a Canvas and an EventSystem when the scene has none; Tools > luanrobs > Signature Pad > Documentation.
  • No mutable static state, so the package needs no reset when Domain Reload is disabled.
  • Demo sample with five scenes: menu, "sign here" form in uGUI, the same form in UI Toolkit, a gallery that saves signatures as JSON and reloads them, and a replay scene. The sample needs uGUI.
  • Manual with the JSON and SVG formats, API reference, limitations and troubleshooting.
  • EditMode and PlayMode tests.

Fixed before release (2026-10-20, after a code review)

  • A pointer that went down again while its stroke was still open (its pointer up was lost, for example when the application lost the focus before the pointer moved) joined the two strokes with a straight line. The stale stroke is now committed and a new one starts; losing the focus or pausing the application also finishes the stroke (uGUI and UI Toolkit).
  • UI Toolkit: the cancel of another pointer (a palm rejected by the system while a pen draws) ended the pen's stroke. Only the cancel or lost capture of the pointer that draws ends it now.
  • FromJson and LoadJson refuse data beyond fixed limits (10,000 strokes, 100,000 points, pen widths up to 1,000 units, coordinates within 1,000,000 units), and very wide pens rasterise in bounded time: 300 points with a 100,000-unit pen took 36 s to export at 600 x 200 pixels (measured outside Unity before the fix); the same points take 0.7 s at 1200 x 400 in the Unity Editor now.
  • Validate rejected only perfectly level lines; the new rule minPathRatio (default 1.25, issue TooStraight) rejects any single straight line.
  • Several pointer moves handled in one frame made fast ink up to about 35% too thick; the speed now uses the path since the last usable time step.
  • A sharp turn (more than 90 degrees) at speed drew a small hook beyond the tip; the curve now makes a corner there.
  • An export with a huge scale or pad size could skip the size cap and return a blank 1 x 1 image; the layout is now computed in double precision.
  • A replay never ended for a long pause inside a stroke; maxPause now shortens every wait, inside strokes as well as between them.
  • Fit threw for ink whose bounds overflow a float.
  • On a transparent background, the on-screen ink had a dark fringe from texture filtering; transparent texels next to the ink now carry its colour.
  • The upload staging texture was re-created several times per second while drawing; one is kept per size. A pad whose size changes reuses its pixel buffers.
  • UI Toolkit: the texture resolution now includes the USS scale of the element and its ancestors.
  • Create Signature Pad in Prefab Mode put the pad and an EventSystem into the main scene; it now creates them inside the prefab and adds no EventSystem there.

Tested

  • Unity 6000.3.12f1 on Windows 11, development project, 2026-10-20 (after the fixes above): 269 of 269 EditMode tests passed, among them pixel comparisons against reference images (goldens); 45 of 45 PlayMode tests passed in the Editor on Direct3D 11.
  • Unity 6000.3.12f1 Windows player (Mono, Direct3D 12, 1280 x 720), 2026-10-20 (after the fixes above): a test driver walked the five demo scenes, replayed a signature on every pad, drew a stroke through each view's pointer entry points, ran the exports and the scenes' own Save, Reload and Replay, and passed with no error logged. Legacy Input Manager; input was simulated inside the engine.
  • Clean projects, 2026-10-20 (final code): the package installed from a .tgz archive into a new project created with Unity 6000.3.12f1 and one created with Unity 6000.0.84f1. On each: 269 of 269 EditMode and 45 of 45 PlayMode tests passed, every sample scene opened with no missing scripts, and the test driver passed in a Mono Windows player.
  • IL2CPP Windows player, Unity 6000.3.12f1 only, 2026-10-20 (final code): the test driver passed. Not run with IL2CPP on 6000.0.84f1.
  • Galaxy S23 (Android 16, arm64): test driver and adb touch input passed, 2026-10-20 (final code): a Unity 6000.3.12f1 IL2CPP build; the test driver passed on the device, and adb input strokes in the uGUI and UI Toolkit forms were drawn, undone, redone, saved and cleared, with the exported JSON matching; the replay scene filled the pad by itself, and a stroke interrupted by the Home button stayed separate from the next one.
  • Android (IL2CPP), x86-64 emulators only, 2026-10-16, before the fixes above: a Unity 6000.3.12f1 build on API 36 and a Unity 6000.0.84f1 build on API 24 with OpenGL ES 3 (the graphics API of the API 36 run was not recorded); the test driver passed on both.
  • Play mode with Domain Reload disabled, Unity 6000.3.12f1, 2026-10-20: three Play sessions in a row passed, with one package texture per session.
  • Without uGUI and the Input System, 2026-10-20: the package compiles, SignaturePad is absent as intended, and 252 of 252 EditMode tests passed.
  • Input System package only (Active Input Handling set to Input System), Unity 6000.3.12f1, 2026-10-20: 269 of 269 EditMode tests passed, the sample scenes opened and the test driver passed in a Mono Windows player.
  • Not run: a mouse, finger or pen used by a person (touch on the S23 was sent with adb input), real pen pressure, other physical devices, iOS, macOS, Linux, WebGL, URP and HDRP.

Known limitations

  • No placing of signatures onto existing PDF pages, no cryptographic or legally qualified digital signatures, no handwriting recognition.
  • Not a painting tool: no brushes, fill, layers or eraser.
  • One pointer at a time; drawing with several fingers at once is not supported.
  • While drawing, the ink ends one stored sample behind the pointer and catches up when the pointer goes up.
  • Pen pressure was exercised with synthetic events only.
  • Clear cannot be undone.
  • Drawing, loading and exporting run on the main thread and take longer with more ink; FromJson refuses data beyond fixed limits.
  • A pad whose size changes every frame redraws its ink and re-creates its texture every frame.
  • The on-screen texture is capped (MaxTextureSize); exports are rendered again from the data and are not affected.
  • In Edit mode the pads show their background colour (and, in UI Toolkit, the placeholder) only; ink exists in Play mode.