a button to repaint
This commit is contained in:
parent
6a11ebf440
commit
49cf653dba
6 changed files with 130 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue