@aurigma/design-atoms-model
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
61 lines • 3.23 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { BaseItem } from "./BaseItem";
import * as _ from "underscore";
import { equals, arrayReferenceEquals } from "../../Utils/Utils";
var SmartItem = /** @class */ (function (_super) {
__extends(SmartItem, _super);
function SmartItem() {
var _this = _super.call(this) || this;
_this.type = SmartItem.type;
return _this;
}
SmartItem.prototype._copy = function (source, destination, generateNewIds, appropriateParentContainer) {
_super.prototype._copy.call(this, source, destination, generateNewIds, appropriateParentContainer);
destination.sourceDpi = source.sourceDpi;
destination.smartObjectDpi = source.smartObjectDpi;
destination.smartObjectRectangle = source.smartObjectRectangle;
destination.smartObjectSize = source.smartObjectSize;
destination.smartObjectStorageId = source.smartObjectStorageId;
if (source.warpControlPoints != null)
destination.warpControlPoints = source.warpControlPoints.map(function (i) { return i; });
if (source.projectiveTransform != null)
destination.projectiveTransform = source.projectiveTransform.map(function (i) { return i; });
if (source.vectorMask != null)
destination.vectorMask = source.vectorMask.map(function (i) { return i; });
return destination;
};
SmartItem.prototype.equals = function (other) {
return _super.prototype.equals.call(this, other) &&
equals(this.sourceDpi, other.sourceDpi) &&
equals(this.smartObjectDpi, other.smartObjectDpi) &&
_.isEqual(this.smartObjectRectangle, other.smartObjectRectangle) &&
_.isEqual(this.smartObjectSize, other.smartObjectSize) &&
equals(this.smartObjectStorageId, other.smartObjectStorageId) &&
arrayReferenceEquals(this.warpControlPoints, other.warpControlPoints) &&
arrayReferenceEquals(this.projectiveTransform, other.projectiveTransform) &&
arrayReferenceEquals(this.vectorMask, other.vectorMask);
};
SmartItem.prototype.clone = function (generateNewIds, appropriateParentContainer) {
if (generateNewIds === void 0) { generateNewIds = false; }
if (appropriateParentContainer === void 0) { appropriateParentContainer = false; }
var item = new SmartItem();
this._copy(this, item, generateNewIds, appropriateParentContainer);
return item;
};
SmartItem.type = "SmartItem";
return SmartItem;
}(BaseItem));
export { SmartItem };
//# sourceMappingURL=SmartItem.js.map