Finite boards (#1)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
import {sqrt2} from './utils.js';
|
||||
import {POINTY} from './consts.js';
|
||||
|
||||
export default class DrawSquare {
|
||||
constructor(settings) {
|
||||
@@ -11,8 +11,8 @@ export default class DrawSquare {
|
||||
|
||||
filled(context, scale, x, y, cell) {
|
||||
scale = scale * cell.scale;
|
||||
let squareCornerX = cell.pointyTop ? this.diamondX : this.squareX;
|
||||
let squareCornerY = cell.pointyTop ? this.diamondY : this.squareY;
|
||||
let squareCornerX = cell.orientation === POINTY ? this.diamondX : this.squareX;
|
||||
let squareCornerY = cell.orientation === POINTY ? this.diamondY : this.squareY;
|
||||
|
||||
context.beginPath();
|
||||
context.moveTo(x + scale * squareCornerX[0], y + scale * squareCornerY[0]);
|
||||
@@ -26,8 +26,8 @@ export default class DrawSquare {
|
||||
|
||||
outline(context, scale, x, y, cell) {
|
||||
scale = scale * cell.scale;
|
||||
let squareCornerX = cell.pointyTop ? this.diamondX : this.squareX;
|
||||
let squareCornerY = cell.pointyTop ? this.diamondY : this.squareY;
|
||||
let squareCornerX = cell.orientation === POINTY ? this.diamondX : this.squareX;
|
||||
let squareCornerY = cell.orientation === POINTY ? this.diamondY : this.squareY;
|
||||
|
||||
context.beginPath();
|
||||
context.moveTo(x + scale * squareCornerX[0], y + scale * squareCornerY[0]);
|
||||
|
||||
Reference in New Issue
Block a user