UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 829 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{equals as t}from"../../../../core/arrayUtils.js";import{rotate as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{AccumulationType as i}from"./UpdateVertices.js";class e{constructor(t,a,e=i.CUMULATIVE){this.origin=t,this.angle=a,this._accumulationType=e}_rotate(t,i){a(t.pos,t.pos,this.origin,i)}apply(t){this._rotate(t,this.angle)}undo(t){this._rotate(t,-this.angle)}canAccumulate(a){return a instanceof e&&t(this.origin,a.origin)}accumulate(t,a){const e=a._accumulationType===i.REPLACE;this._rotate(t,e?a.angle-this.angle:a.angle)}accumulateParams(t){const a=t._accumulationType===i.REPLACE;this.angle=a?t.angle:this.angle+t.angle}}export{e as RotateVertex};