1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-26 08:09:11 +02:00

Explanation section (#260)

* rewritten
This commit is contained in:
Pomax
2020-08-08 14:18:23 -07:00
committed by GitHub
parent e784a5e33d
commit f2b7db8657
11 changed files with 133 additions and 89 deletions

View File

@@ -191,8 +191,8 @@ class GraphicsAPI extends BaseAPI {
*/
line(x1, y1, x2, y2) {
this.ctx.beginPath();
this.ctx.moveTo(x1 + 0.5, y1 + 0.5);
this.ctx.lineTo(x2 + 0.5, y2 + 0.5);
this.ctx.moveTo(x1, y1);
this.ctx.lineTo(x2, y2);
this.ctx.stroke();
}
@@ -201,7 +201,7 @@ class GraphicsAPI extends BaseAPI {
*/
circle(x, y, r) {
this.ctx.beginPath();
this.ctx.arc(x + 0.5, y + 0.5, r, 0, this.TAU);
this.ctx.arc(x, y, r, 0, this.TAU);
this.ctx.fill();
this.ctx.stroke();
}
@@ -214,15 +214,15 @@ class GraphicsAPI extends BaseAPI {
y = x.y;
x = x.x;
}
this.ctx.fillText(str, x + 0.5, y + 0.5);
this.ctx.fillText(str, x, y);
}
/**
* Draw a rectangle start with {p} in the upper left
*/
rect(x, y, w, h) {
this.ctx.fillRect(x + 0.5, y + 0.5, w, h);
this.ctx.strokeRect(x + 0.5, y + 0.5, w, h);
this.ctx.fillRect(x, y, w, h);
this.ctx.strokeRect(x, y, w, h);
}
/**