I guess I didn't test before that last commit
This commit is contained in:
@@ -50,7 +50,7 @@ export default class CartographerFlatXYZ extends Cartographer {
|
||||
}
|
||||
|
||||
tileToPixel(hex) {
|
||||
hex = typeof hex === 'Hex' ? hex : new Hex(...arguments);
|
||||
hex = hex instanceof Hex ? hex : new Hex(...arguments);
|
||||
|
||||
const pixelX = this.scale * 3/2 * hex.getQ();
|
||||
const pixelY = this.scale * sqrt3 * (hex.getR() + (hex.getQ() / 2));
|
||||
@@ -59,7 +59,7 @@ export default class CartographerFlatXYZ 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;
|
||||
|
||||
Reference in New Issue
Block a user