Finite boards (#1)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import {POINTY} from './consts.js';
|
||||
|
||||
export default class DrawHexagon {
|
||||
constructor(settings) {
|
||||
@@ -33,8 +34,8 @@ export default class DrawHexagon {
|
||||
|
||||
outline(context, scale, x, y, cell) {
|
||||
scale = scale * cell.scale;
|
||||
let hexCornerX = cell.pointyTop ? this.pointyTopCornerX : this.flatTopCornerX;
|
||||
let hexCornerY = cell.pointyTop ? this.pointyTopCornerY : this.flatTopCornerY;
|
||||
let hexCornerX = cell.orientation === POINTY ? this.pointyTopCornerX : this.flatTopCornerX;
|
||||
let hexCornerY = cell.orientation === POINTY ? this.pointyTopCornerY : this.flatTopCornerY;
|
||||
|
||||
context.beginPath();
|
||||
context.moveTo(x + scale * hexCornerX[0], y + scale * hexCornerY[0]);
|
||||
@@ -52,8 +53,8 @@ export default class DrawHexagon {
|
||||
|
||||
filled(context, scale, x, y, cell) {
|
||||
scale = scale * cell.scale;
|
||||
let hexCornerX = cell.pointyTop ? this.pointyTopCornerX : this.flatTopCornerX;
|
||||
let hexCornerY = cell.pointyTop ? this.pointyTopCornerY : this.flatTopCornerY;
|
||||
let hexCornerX = cell.orientation === POINTY ? this.pointyTopCornerX : this.flatTopCornerX;
|
||||
let hexCornerY = cell.orientation === POINTY ? this.pointyTopCornerY : this.flatTopCornerY;
|
||||
|
||||
context.beginPath();
|
||||
context.moveTo(x + scale * hexCornerX[0], y + scale * hexCornerY[0]);
|
||||
|
||||
Reference in New Issue
Block a user