@@ -84,6 +84,8 @@ export default class Sigpad {
84
84
85
85
this . _element . width = this . _element . clientWidth ;
86
86
this . _element . height = this . _element . clientHeight ;
87
+
88
+ this . render ( true ) ;
87
89
}
88
90
89
91
destroy ( ) {
@@ -143,10 +145,7 @@ export default class Sigpad {
143
145
}
144
146
145
147
setImage ( image ) {
146
- if ( this . _config . backgroundColor != null && this . _config . backgroundColor != "" ) {
147
- ctx . fillStyle = this . _config . backgroundColor ;
148
- ctx . fillRect ( 0 , 0 , this . _element . width , this . _element . height ) ;
149
- }
148
+
150
149
151
150
if ( this . _config . backgroundImage != null && this . _config . backgroundImage != "" ) {
152
151
this . setBackgroundImage ( this . _config . backgroundImage ) ;
@@ -285,6 +284,12 @@ export default class Sigpad {
285
284
286
285
ctx . clearRect ( 0 , 0 , this . _element . width , this . _element . height ) ;
287
286
287
+ if ( this . _config . backgroundColor != null && this . _config . backgroundColor != "" ) {
288
+ ctx . fillStyle = this . _config . backgroundColor ;
289
+ ctx . fillRect ( 0 , 0 , this . _element . width , this . _element . height ) ;
290
+ }
291
+
292
+
288
293
if ( this . _bgImg != undefined && this . _bgImg . complete ) {
289
294
ctx . drawImage ( this . _bgImg , 0 , 0 ,
290
295
this . _bgImg . width * window . devicePixelRatio ,
0 commit comments