Refactor Maps (#2)
This commit is contained in:
@@ -50,6 +50,8 @@ export default class CartographerFlatXY extends Cartographer {
|
||||
}
|
||||
|
||||
tileToPixel(square) {
|
||||
square = typeof square === 'Square' ? square : new Square(...arguments);
|
||||
|
||||
const x = square.getX() * this.minWidth();
|
||||
const y = square.getY() * this.minWidth();
|
||||
|
||||
@@ -57,6 +59,8 @@ export default class CartographerFlatXY extends Cartographer {
|
||||
}
|
||||
|
||||
pixelToTile(point) {
|
||||
point = typeof point === 'Point' ? point : new Point(x, y);
|
||||
|
||||
const pixelX = point.getX() - this.originX;
|
||||
const pixelY = this.originY - point.getY();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user