I guess I didn't test before that last commit

This commit is contained in:
Gavin McDonald
2018-07-17 21:04:53 -04:00
parent 57ada13a8d
commit e4b9b87f44
6 changed files with 8 additions and 12 deletions

View File

@@ -50,7 +50,7 @@ export default class CartographerPointyXYZ extends Cartographer {
}
tileToPixel(hex) {
hex = typeof hex === 'Hex' ? hex : new Hex(...arguments);
hex = hex instanceof Hex ? hex : new Hex(...arguments);
const pixelX = this.scale * sqrt3 * (hex.getQ() + (hex.getR() / 2));
const pixelY = this.scale * 3/2 * hex.getR();
@@ -59,7 +59,7 @@ export default class CartographerPointyXYZ extends Cartographer {
}
pixelToTile(point) {
point = typeof point === 'Point' ? point : new Point(x, y);
point = point instanceof Point ? point : new Point(...arguments);
const pixelX = point.getX() - this.originX;
const pixelY = point.getY() - this.originY;