{
cx.clearRect(-width/2, -height/2, width, height);
for (let i = -50; i < 50; ++i) {
for (let j = -100; j < 50; ++j) {
const x = x1 * i + x2 * j;
const y = y1 * i + y2 * j;
cx.fillStyle = "rgba(0,0,255,0.2)";
cx.fillRect(x, y, x1+x2, y1-y2);
cx.fillStyle = "rgba(255,0,0,0.2)";
cx.fillRect(x, y, -(x1-x2), -(y1+y2));
}
}
for (let i = -50; i < 50; ++i) {
for (let j = -100; j < 50; ++j) {
const x = x1 * i + x2 * j;
const y = y1 * i + y2 * j;
cx.strokeStyle = "blue";
cx.strokeRect(x, y, x1+x2, y1-y2);
}
}
}