1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-28 10:40:52 +02:00

generalised curve fitting

This commit is contained in:
Pomax
2020-09-01 22:28:09 -07:00
parent fc13f64451
commit 4aef67e662
37 changed files with 500 additions and 210 deletions

View File

@@ -633,11 +633,12 @@ class GraphicsAPI extends BaseAPI {
* convenient grid drawing function
*/
drawGrid(division = 20) {
for (let x = (division / 2) | 0; x < this.width; x += division) {
this.line({ x, y: 0 }, { x, y: this.height });
let w = this.panelWidth ?? this.width;
for (let x = (division / 2) | 0; x < w; x += division) {
this.line(x, 0, x, this.height);
}
for (let y = (division / 2) | 0; y < this.height; y += division) {
this.line({ x: 0, y }, { x: this.width, y });
this.line(0, y, w, y);
}
}