/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{copy as e}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as t,offset as s,copy as i}from"../../../geometry/support/aaBoundingRect.js";import{fromValues as n}from"../webgl-engine/lib/LocalOriginFactory.js";class r{constructor(){this._extent=t(),this.resolution=0,this.renderLocalOrigin=n(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new o}get extent(){return this._extent}setExtent(t){e(this._extent,t)}setupGeometryViews(e){if(this._setupGeometryView(),!e)return;const t=.001*e.range;if(this._extent[0]-t<=e.min){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];s(this._extent,e.range,0,t)}if(this._extent[2]+t>=e.max){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];s(this._extent,-e.range,0,t)}}_setupGeometryView(){this.canvasGeometries.numViews=1,i(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class o{constructor(){this.extents=[t(),t(),t()],this.numViews=0}}export{r as Overlay};
