UNPKG

303 BJavaScriptView Raw
1const fixFactor = Math.sqrt(2);
2/**
3 * @category Shape Drawers
4 */
5export class SquareDrawer {
6 getSidesCount() {
7 return 4;
8 }
9 draw(context, particle, radius) {
10 context.rect(-radius / fixFactor, -radius / fixFactor, (radius * 2) / fixFactor, (radius * 2) / fixFactor);
11 }
12}