1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00
tobspr_shapez.io/src/js/core/draw_parameters.js

31 lines
831 B
JavaScript
Raw Normal View History

2020-05-09 14:45:23 +00:00
import { Rectangle } from "./rectangle";
2020-05-18 15:40:20 +00:00
import { globalConfig } from "./config";
2020-05-09 14:45:23 +00: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 15:40:20 +00:00
if (G_IS_DEV && globalConfig.debug.testClipping) {
this.visibleRect = this.visibleRect.expandedInAllDirections(-100);
}
2020-05-09 14:45:23 +00:00
}
}