1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-11 06:24:22 +00:00
TiddlyWiki5/core/modules/editor/operations/bitmap/clear.js
2016-04-22 08:36:29 +01:00

25 lines
542 B
JavaScript

/*\
title: $:/core/modules/editor/operations/bitmap/clear.js
type: application/javascript
module-type: bitmapeditoroperation
Bitmap editor operation to clear the image
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports["clear"] = function(event) {
var ctx = this.canvasDomNode.getContext("2d");
ctx.globalAlpha = 1;
ctx.fillStyle = event.paramObject.colour || "white";
ctx.fillRect(0,0,this.canvasDomNode.width,this.canvasDomNode.height);
// Save changes
this.strokeEnd();
};
})();