electron/spec/fixtures/crash-cases/worker-multiple-destroy/worklet.js
Milan Burda 82af000a37
chore: cleanup eslint suppressions (#38417)
* chore: cleanup eslint suppressions

* address feedback

* revert script/lib/azput.js

* revert spec/fixtures/apps/remote-control/main.js

* address feedback

* revert typings/internal-ambient.d.ts
2023-05-25 10:09:17 +09:00

19 lines
517 B
JavaScript

/* global registerPaint */
class CheckerboardPainter {
paint (ctx, geom, properties) {
const colors = ['red', 'green', 'blue'];
const size = 32;
for (let y = 0; y < (geom.height / size); y++) {
for (let x = 0; x < (geom.width / size); x++) {
const color = colors[(x + y) % colors.length];
ctx.beginPath();
ctx.fillStyle = color;
ctx.rect(x * size, y * size, size, size);
ctx.fill();
}
}
}
}
registerPaint('checkerboard', CheckerboardPainter);