@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
28 lines • 908 B
JavaScript
// ReSharper disable InconsistentNaming
/**
* This is a base class for all the classes which represent a state of a vector object.
*/
export class ItemHandlerData {
constructor(handler) {
this.__type = "ItemHandlerData";
this.P = [];
this.Tg = null;
this.ID = (`vo${new Date().getTime()}`) + Math.round(Math.random() * 1000);
if (handler) {
this.P = handler.controlPoints;
this.Tg = handler.tag;
this.ID = handler.uniqueId;
}
}
applyState(itemData, handler) {
if (handler) {
handler.beginUpdate();
handler.controlPoints = itemData.P;
handler.tag = itemData.Tg;
handler.uniqueId = itemData.ID;
handler.endUpdate();
}
}
}
// ReSharper restore InconsistentNaming
//# sourceMappingURL=ItemHandlerData.js.map