UNPKG

@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.

90 lines 3.8 kB
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 { LineItem } from "./LineItem"; import { Color, RgbColors } from "../../Colors"; import * as Math from "../../Math/Common"; import { equals } from "../../Utils/Utils"; var DashedLineItem = /** @class */ (function (_super) { __extends(DashedLineItem, _super); function DashedLineItem(sourcePoint0, sourcePoint1) { var _this = _super.call(this, sourcePoint0, sourcePoint1) || this; _this._dashWidth = 3; _this._altDashWidth = 3; _this._altColor = RgbColors.transparent; _this.type = DashedLineItem.type; return _this; } Object.defineProperty(DashedLineItem.prototype, "dashWidth", { get: function () { return this._dashWidth; }, set: function (value) { if (Math.EqualsOfFloatNumbers(this._dashWidth, value)) return; this._dashWidth = value; this._propertyChanged.notify(this, "dashWidth"); }, enumerable: true, configurable: true }); Object.defineProperty(DashedLineItem.prototype, "altDashWidth", { get: function () { return this._altDashWidth; }, set: function (value) { if (Math.EqualsOfFloatNumbers(this._altDashWidth, value)) return; this._altDashWidth = value; this._propertyChanged.notify(this, "altDashWidth"); }, enumerable: true, configurable: true }); Object.defineProperty(DashedLineItem.prototype, "altColor", { get: function () { return this._altColor; }, set: function (value) { if (Color.equals(this._altColor, value)) return; this._altColor = value; this._propertyChanged.notify(this, "altColor"); }, enumerable: true, configurable: true }); DashedLineItem.prototype._copy = function (source, destination, generateNewIds, appropriateParentContainer) { _super.prototype._copy.call(this, source, destination, generateNewIds, appropriateParentContainer); destination.dashWidth = source.dashWidth; destination.altDashWidth = source.altDashWidth; destination.altColor = source.altColor.clone(); }; DashedLineItem.prototype.equals = function (other) { return _super.prototype.equals.call(this, other) && equals(this._dashWidth, other._dashWidth) && equals(this._altDashWidth, other._altDashWidth) && equals(this._altColor, other._altColor); }; DashedLineItem.prototype.clone = function (generateNewIds, appropriateParentContainer) { if (generateNewIds === void 0) { generateNewIds = false; } if (appropriateParentContainer === void 0) { appropriateParentContainer = false; } var item = new DashedLineItem(); this._copy(this, item, generateNewIds, appropriateParentContainer); return item; }; DashedLineItem.type = "DashedLineItem"; return DashedLineItem; }(LineItem)); export { DashedLineItem }; //# sourceMappingURL=DashedLineItem.js.map