This repository has been archived on 2021-02-20. You can view files and clone it, but cannot push or open issues or pull requests.
2020-05-09 16:45:23 +02:00
|
|
|
import { Rectangle } from "./rectangle";
|
2020-05-18 17:40:20 +02:00
|
|
|
import { globalConfig } from "./config";
|
2020-05-09 16:45:23 +02:00
|
|
|
|
|
|
|
/* typehints:start */
|
|
|
|
import { GameRoot } from "../game/root";
|
|
|
|
/* typehints:end */
|
|
|
|
|
|
|
|
export class DrawParameters {
|
|
|
|
constructor({ context, visibleRect, desiredAtlasScale, zoomLevel, root }) {
|
|
|
|
/** @type {CanvasRenderingContext2D} */
|
|
|
|
this.context = context;
|
|
|
|
|
|
|
|
/** @type {Rectangle} */
|
|
|
|
this.visibleRect = visibleRect;
|
|
|
|
|
|
|
|
/** @type {number} */
|
|
|
|
this.desiredAtlasScale = desiredAtlasScale;
|
|
|
|
|
|
|
|
/** @type {number} */
|
|
|
|
this.zoomLevel = zoomLevel;
|
|
|
|
|
|
|
|
// FIXME: Not really nice
|
|
|
|
/** @type {GameRoot} */
|
|
|
|
this.root = root;
|
2020-05-18 17:40:20 +02:00
|
|
|
|
|
|
|
if (G_IS_DEV && globalConfig.debug.testClipping) {
|
|
|
|
this.visibleRect = this.visibleRect.expandedInAllDirections(-100);
|
|
|
|
}
|
2020-05-09 16:45:23 +02:00
|
|
|
}
|
|
|
|
}
|