diff --git a/src/index.android.ts b/src/index.android.ts index fcadb99..547f2f9 100644 --- a/src/index.android.ts +++ b/src/index.android.ts @@ -99,14 +99,19 @@ export class DrawingPad extends DrawingPadBase { if (!this.nativeView.isEmpty()) { const data: string = this.nativeView.getSignatureSvg(); - // Append viewbox to the svg for correct scaling - const svgHeaderRegEx = //i; - resolve( - data.replace( - svgHeaderRegEx, - `` - ) - ); + // Append viewbox to the svg for correct scaling (IF NEEDED) + if (data.indexOf('viewBox') === -1) { + const svgHeaderRegEx = //i; + resolve( + data.replace( + svgHeaderRegEx, + `` + ) + ); + } else { + resolve(data); + } + } else { reject('DrawingPad is empty.'); }