Skip to content

Commit

Permalink
Fix signature pad doesn't render sign image in some cases (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 authored Nov 12, 2024
1 parent ed331da commit 81e3dd5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/flat_layout/flat_signaturepad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ export class FlatSignaturePad extends FlatQuestion {
public async generateBackgroundImage(point: IPoint): Promise<IPdfBrick> {
return await SurveyHelper.createImageFlat(point, this.question, this.controller, { link: this.question.backgroundImage, width: SurveyHelper.pxToPt(<any>this.question.signatureWidth), height: SurveyHelper.pxToPt(<any>this.question.signatureHeight), objectFit: 'cover' }, true);
}
private getSignImageUrl() {
return this.question.storeDataAsText || !this.question.loadedData ? this.question.value : this.question.loadedData;
}
public async generateSign(point: IPoint): Promise<IPdfBrick> {
const width = SurveyHelper.pxToPt(<any>this.question.signatureWidth);
const height = SurveyHelper.pxToPt(<any>this.question.signatureHeight);
if(this.question.value) {
return await SurveyHelper.createImageFlat(point,
this.question, this.controller, { link: this.question.storeDataAsText ? this.question.value : this.question.loadedData,
this.question, this.controller, { link: this.getSignImageUrl(),
width: width,
height: height }, false
);
Expand Down
Loading

0 comments on commit 81e3dd5

Please sign in to comment.