import { canvas } from './canvas' class Viewport { constructor (x, y, scale = 1) { this.x = x this.y = y this.scale = scale } get width () { return canvas.width } get height () { return canvas.height } chunkIn (size) { return { x: Math.floor((this.x + this.width / 2) / size), y: Math.floor((this.y + this.height / 2) / size) } } } export default Viewport