Browse code

paste sketch: use fillRect to get white background

devnewton authored on 09/03/2017 at 12:49:22
Showing 1 changed files
... ...
@@ -124,7 +124,8 @@
124 124
             if (that.background) {
125 125
                 context.drawImage(that.background, 0, 0, canvasSize.width, canvasSize.height);
126 126
             } else {
127
-                context.clearRect(0, 0, canvasSize.width, canvasSize.height);
127
+                context.fillStyle = "#ffffff";
128
+                context.fillRect(0, 0, canvasSize.width, canvasSize.height);
128 129
             }
129 130
         }
130 131
 
... ...
@@ -281,7 +282,7 @@
281 281
         this.background = img;
282 282
         this.redraw();
283 283
     };
284
-    
284
+
285 285
     Sketchpad.prototype.getBackground = function () {
286 286
         return this.background;
287 287
     };