mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-30 21:12:40 +00:00
25 lines
542 B
JavaScript
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();
|
|
};
|
|
|
|
})();
|