Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
f1bd085384 | |||
6661936188 |
14
canvas.ts
14
canvas.ts
@@ -81,6 +81,7 @@ export class Doodler {
|
||||
}
|
||||
|
||||
protected draw() {
|
||||
this.ctx.clearRect(0, 0, this.width, this.height);
|
||||
this.ctx.fillStyle = this.bg;
|
||||
this.ctx.fillRect(0, 0, this.width, this.height);
|
||||
// for (const d of this.draggables.filter(d => d.beingDragged)) {
|
||||
@@ -245,6 +246,10 @@ export class Doodler {
|
||||
this.ctx.strokeText(text, pos.x, pos.y, maxWidth);
|
||||
}
|
||||
|
||||
clearRect(at: Vector, width: number, height: number) {
|
||||
this.ctx.clearRect(at.x, at.y, width, height);
|
||||
}
|
||||
|
||||
// Interaction
|
||||
|
||||
mouseX = 0;
|
||||
@@ -409,6 +414,15 @@ interface IStyle {
|
||||
|
||||
noStroke?: boolean;
|
||||
noFill?: boolean;
|
||||
|
||||
textAlign?: "center" | "end" | "left" | "right" | "start";
|
||||
textBaseline?:
|
||||
| "alphabetic"
|
||||
| "top"
|
||||
| "hanging"
|
||||
| "middle"
|
||||
| "ideographic"
|
||||
| "bottom";
|
||||
}
|
||||
|
||||
interface IDrawable {
|
||||
|
Reference in New Issue
Block a user