diff --git a/src/cartographer.js b/src/cartographer.js index 9f5c6e7..07a00e5 100644 --- a/src/cartographer.js +++ b/src/cartographer.js @@ -2,6 +2,8 @@ import {has} from './utils.js'; import {pick} from './funky'; const DEFAULTS = { + adjustScaleMin: true, + // in pixels scale: 50, scaleMin: 10, @@ -54,9 +56,7 @@ export default class Cartographer { const widthMin = this.width ? this.calculateHorizontalScale(canvasWidth, this.width) : 0; this.scaleMax = this.settings.scaleMax; -// this.scaleMin = Math.max(this.settings.scaleMin, heightMin, widthMin); -// this.scaleMin = this.wrap ? this.settings.scaleMin : Math.max(this.settings.scaleMin, heightMin, widthMin); - this.scaleMin = this.settings.scaleMin; + this.scaleMin = this.settings.adjustScaleMin ? Math.max(this.settings.scaleMin, heightMin, widthMin) : this.settings.scaleMin; this.scale = this.scaleMin > this.settings.scale ? this.scaleMin : this.settings.scale; } @@ -112,9 +112,7 @@ export default class Cartographer { const maxX = this.tileWidth() / 2; const minY = canvasHeight - (this.tileHeight() / 2); - if (this.wrap) { - } - else { + if (!this.wrap) { this.originX = this.originX > maxX ? maxX : this.originX; this.originY = this.originY < minY ? minY : this.originY; @@ -138,9 +136,7 @@ export default class Cartographer { const colWidth = this.horizontalDistance(); const rowHeight = this.verticalDistance(); - if (this.wrap) { - } - else { + if (!this.wrap) { if (this.width) { const canvasWidth = event.width; const halfBoardWidth = (this.width * colWidth + this.horizontalOverhang()) / 2;