update setting origin for non-negative boards
This commit is contained in:
@@ -54,16 +54,16 @@ export default class Cartographer {
|
|||||||
setOriginX (canvasWidth, centerX) {
|
setOriginX (canvasWidth, centerX) {
|
||||||
this.originX = centerX ? centerX - canvasWidth / 2 :
|
this.originX = centerX ? centerX - canvasWidth / 2 :
|
||||||
this.negativeTiles ? parseInt(canvasWidth / 2) :
|
this.negativeTiles ? parseInt(canvasWidth / 2) :
|
||||||
this.width ? ((this.width * this.tileWidth()) / -2) + (canvasWidth / 2) + (this.tileWidth() / 2) :
|
this.width ? ((this.width * this.horizontalDistance()) / -2) + (canvasWidth / 2) + (this.horizontalDistance() / 2) :
|
||||||
this.tileWidth() / 2;
|
this.tileWidth() / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
setOriginY (canvasHeight, centerY) {
|
setOriginY (canvasHeight, centerY) {
|
||||||
const boardHeight = this.height * this.tileHeight();
|
const boardHeight = this.height * this.verticalDistance();
|
||||||
|
|
||||||
this.originY = centerY ? centerY + canvasHeight / 2 :
|
this.originY = centerY ? centerY + canvasHeight / 2 :
|
||||||
this.negativeTiles ? parseInt(canvasHeight / 2) :
|
this.negativeTiles ? parseInt(canvasHeight / 2) :
|
||||||
this.height ? (boardHeight) - ((boardHeight - canvasHeight) / 2) - (this.tileHeight() / 2) :
|
this.height ? (boardHeight) - ((boardHeight - canvasHeight) / 2) - (this.verticalDistance() / 2) :
|
||||||
canvasHeight - (this.tileHeight() / 2);
|
canvasHeight - (this.tileHeight() / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user