/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{deg2rad as t}from"../../../../core/mathUtils.js";import{fromTranslation as a,scale as e,translate as s,rotate as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{DisplayObject as l}from"../DisplayObject.js";class o extends l{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){null!=this._displayData&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(r){const{displayData:l}=this;if(null==l)return;const o=l.extent.xmin,n=l.extent.ymax,p=[0,0];r.toScreen(p,[o,n]);const m=(l.extent.xmax-l.extent.xmin)/l.size[0]/r.resolution,c=t(r.rotation),{displayViewScreenMat3:x}=this.transforms;a(x,[-1,1,0]),e(x,x,[2/(r.size[0]*r.pixelRatio),-2/(r.size[1]*r.pixelRatio),1]),s(x,x,[p[0],p[1],0]),i(x,x,c),e(x,x,[m*r.pixelRatio,m*r.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:r()}}}export{o as FlowDisplayObject};
