RomanBase / hand_signature

A Flutter plugin providing signature pad for drawing smooth signatures.
https://pub.dev/packages/hand_signature
MIT License
108 stars 25 forks source link

toSvg with wrapSignature cuts the signature #35

Closed alexgarbarev closed 1 year ago

alexgarbarev commented 1 year ago

Hello and thank you for wonderful library!

I'd like to raise on minor problem I faced with. Sometimes, when I try to export signature toSvg using following params:

final control = HandSignatureControl();
...
HandSignature(
  control: control,
  width: 2.0,
  maxWidth: 5.0,
)
...      
final svg = control.toSvg(
  wrapSignature: true,
);

I see that the signature gets cutted. I guess it might be related to line width or something. Please see attached screenshots: Actual signature (inside HandSignature)

Screenshot 2023-02-19 at 14 34 09

Exported to svg:

Screenshot 2023-02-19 at 14 34 12

Another example of cropped signature (In svg format): Signature

Thanks in advance for any advice :)

ZdenekKrcal commented 1 year ago

I have same problem, I always get cutted signature with option:

final svg = control.toSvg(
  wrapSignature: true,
);
RomanBase commented 1 year ago

Hey, wrapSignature has been redesigned to fit property to better correspond with properties of other export options. There was a problem with rescaling/filling data during export, so bounds of the signature are now extended with maxStrokeWidth to better fit visible dimensions.

Please check version 3.0.1.

alexgarbarev commented 1 year ago

Thanks @RomanBase it works much better now!

My only humble suggestion is: avoid breaking public API in one patch change (3.0.0 -> 3.0.1) in compliance of semantic versioning: https://semver.org/#spec-item-6. (see items 6 and 7). Instead we could add @deprecated annotation with suggestion to use new property instead. Then remove all deprecation in next major release. That way other developers can plan APIs upgrading.