Higher FPS! (#19)
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import {getColor, sqrt2} from './utils.js';
|
||||
import {getColor, invSqrt2, sqrt2} from './utils.js';
|
||||
import {FLAT, POINTY} from './consts.js';
|
||||
|
||||
export default class DrawSquare {
|
||||
constructor(settings) {
|
||||
this.settings = Object.assign({}, settings);
|
||||
|
||||
this.squareX = [1, 1, -1, -1];
|
||||
this.squareY = [1, -1, -1, 1];
|
||||
this.diamondX = [sqrt2, 0, -sqrt2, 0, sqrt2 / 2, -sqrt2 / 2];
|
||||
this.diamondY = [0, -sqrt2, 0, sqrt2, -sqrt2 / 2, sqrt2 / 2];
|
||||
this.squareX = [invSqrt2, invSqrt2, -invSqrt2, -invSqrt2];
|
||||
this.squareY = [invSqrt2, -invSqrt2, -invSqrt2, invSqrt2];
|
||||
this.diamondX = [1, 0, -1, 0, 0.5, -0.5];
|
||||
this.diamondY = [0, -1, 0, 1, -0.5, 0.5];
|
||||
}
|
||||
|
||||
fill(context, scale, x, y, cell) {
|
||||
|
||||
Reference in New Issue
Block a user