UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 971 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ class i{constructor(i,t){this._editGeometry=i,this._newPositions=t}apply(){const i=null==this._originalPositions?"apply":"redo";if(!this._originalPositions){const i=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map((t=>i.clone(t.pos)))}this._apply(i,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(t){return t instanceof i&&(this._newPositions=t._newPositions,this._apply("apply",this._newPositions),!0)}_apply(i,t){const o=this._editGeometry.coordinateHelper,s=this._editGeometry.allVertices;for(let e=0;e<s.length;e++)o.copy(t[e],s[e].pos);this._editGeometry.components.forEach((i=>i.unnormalizeVertexPositions())),this._editGeometry.notifyChanges({operation:i,updatedVertices:s})}}export{i as SetAllVertexPositions};