/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/mat3","../../../../chunks/mat3f32","./RasterVFDisplayObject","../webgl/TiledDisplayObject"],(function(t,e,s,i,a,l){"use strict";let n=function(t){function l(e,s,i,l,n,r=null){var o;return(o=t.call(this,e,s,i,l,n)||this).tileData=new a.RasterVFDisplayObject(r),o.tileData.coordScale=[l,n],o.tileData.once("isReady",(()=>o.ready())),o}e._inheritsLoose(l,t);var n=l.prototype;return n.destroy=function(){t.prototype.destroy.call(this),this.tileData.destroy(),this.tileData=null,this.stage=null},n._createTransforms=function(){return{dvs:i.create(),tileMat3:i.create()}},n.setTransform=function(e,i){t.prototype.setTransform.call(this,e,i);const a=i/(e.resolution*e.pixelRatio),l=this.transforms.tileMat3,[n,r]=this.tileData.offset,o=[this.x+n*i,this.y-r*i],[h,c]=e.toScreenNoRotation([0,0],o),{symbolTileSize:u}=this.tileData.symbolizerParameters,f=Math.round((this.width-this.tileData.offset[0])/u)*u,d=Math.round((this.height-this.tileData.offset[1])/u)*u,y=f/this.rangeX*a,D=d/this.rangeY*a;s.set(l,y,0,0,0,D,0,h,c,1),s.multiply(this.transforms.dvs,e.displayViewMat3,l),this.tileData.transforms.dvs=this.transforms.dvs},n.onAttach=function(){this.tileData.stage=this.stage},n.onDetach=function(){this.tileData.stage=null},e._createClass(l,[{key:"stencilRef",get:function(){return this.tileData.stencilRef},set:function(t){this.tileData.stencilRef=t}}]),l}(l.TiledDisplayObject);t.RasterVFTile=n,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
