a button to repaint

This commit is contained in:
Blue 2018-11-19 17:09:43 +03:00
parent 6a11ebf440
commit 49cf653dba
6 changed files with 130 additions and 9 deletions

View file

@ -6,6 +6,12 @@ class Canvas {
this.element.width = width;
this.element.height = height;
this._ctx = this.element.getContext("2d");
this._width = width;
this._height = height;
}
clear() {
this.resetStyle();
this._ctx.clearRect(0, 0, this._width, this._height);
}
setFillColor(color) {
this._ctx.fillStyle = color.rgba();
@ -21,6 +27,8 @@ class Canvas {
resize(width, height) {
this.element.width = width;
this.element.height = height;
this._width = width;
this._height = height;
}
}