Skip to content

Commit

Permalink
Signature Pad has black background for dataFormat JPEG #2413
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed Sep 23, 2020
1 parent c7672a6 commit 6c1f2fc
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/question_signaturepad.ts
Expand Up @@ -72,7 +72,7 @@ export class QuestionSignaturePadModel extends Question {
initSignaturePad(el: HTMLElement) {
var canvas: any = el.getElementsByTagName("canvas")[0];
var buttonEl = el.getElementsByTagName("button")[0];
var signaturePad = new SignaturePad(canvas);
var signaturePad = new SignaturePad(canvas, { backgroundColor: "#ffffff" });
if (this.isReadOnly) {
signaturePad.off();
}
Expand Down Expand Up @@ -188,31 +188,38 @@ export class QuestionSignaturePadModel extends Question {
Serializer.addClass(
"signaturepad",
[
{
name: "allowClear:boolean",
default: true,
},
{
name: "width:number",
category: "general",
default: 300,
},
{
name: "height:number",
category: "general",
default: 200,
},
{
name: "penColor",
name: "allowClear:boolean",
category: "general",
default: true,
},
{
name: "penColor:color",
category: "general",
default: "#1ab394",
},
{
name: "dataFormat",
category: "general",
default: "",
choices: [
{ value: "", text: "PNG" },
{ value: "image/jpeg", text: "JPEG" },
{ value: "image/svg+xml", text: "SVG" },
],
},
{ name: "defaultValue", visible: false },
{ name: "correctAnswer", visible: false },
],
function () {
return new QuestionSignaturePadModel("");
Expand Down

0 comments on commit 6c1f2fc

Please sign in to comment.