Skip to content

Commit

Permalink
Merge pull request #11607 from allenve/fix-signature
Browse files Browse the repository at this point in the history
feat: 签名组件全屏模式签名确认后旋转图像
  • Loading branch information
allenve authored Feb 14, 2025
2 parents c195a17 + edc069f commit 10dad55
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/amis-ui/src/components/Signature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,16 @@ const Signature: React.FC<ISignatureProps> = props => {
}, [sign]);
const confirm = React.useCallback(() => {
if (sign) {
const base64 = sign.toDataURL();
setData(base64);
props.onChange?.(base64);
if (fullScreen) {
const canvas = sign.getRotateCanvas(-90);
const base64 = canvas.toDataURL();
setData(base64);
props.onChange?.(base64);
} else {
const base64 = sign.toDataURL();
setData(base64);
props.onChange?.(base64);
}
}
}, [sign]);
const resize = React.useCallback(() => {
Expand Down

0 comments on commit 10dad55

Please sign in to comment.