@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.
59 lines • 2.19 kB
JavaScript
import { LineItem } from "./LineItem";
import { Color, RgbColors } from "../../Colors";
import * as Math from "../../Math/Common";
import { equals } from "../../Utils/Utils";
export class DashedLineItem extends LineItem {
constructor(sourcePoint0, sourcePoint1) {
super(sourcePoint0, sourcePoint1);
this._dashWidth = 3;
this._altDashWidth = 3;
this._altColor = RgbColors.transparent;
this.type = DashedLineItem.type;
}
get dashWidth() {
return this._dashWidth;
}
set dashWidth(value) {
if (Math.EqualsOfFloatNumbers(this._dashWidth, value))
return;
this._dashWidth = value;
this._propertyChanged.notify(this, "dashWidth");
}
get altDashWidth() {
return this._altDashWidth;
}
set altDashWidth(value) {
if (Math.EqualsOfFloatNumbers(this._altDashWidth, value))
return;
this._altDashWidth = value;
this._propertyChanged.notify(this, "altDashWidth");
}
get altColor() {
return this._altColor;
}
set altColor(value) {
if (Color.equals(this._altColor, value))
return;
this._altColor = value;
this._propertyChanged.notify(this, "altColor");
}
_copy(source, destination, generateNewIds, appropriateParentContainer) {
super._copy(source, destination, generateNewIds, appropriateParentContainer);
destination.dashWidth = source.dashWidth;
destination.altDashWidth = source.altDashWidth;
destination.altColor = source.altColor.clone();
}
equals(other) {
return super.equals(other) &&
equals(this._dashWidth, other._dashWidth) &&
equals(this._altDashWidth, other._altDashWidth) &&
equals(this._altColor, other._altColor);
}
clone(generateNewIds = false, appropriateParentContainer = false) {
const item = new DashedLineItem();
this._copy(this, item, generateNewIds, appropriateParentContainer);
return item;
}
}
DashedLineItem.type = "DashedLineItem";
//# sourceMappingURL=DashedLineItem.js.map