@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.
63 lines • 2.31 kB
JavaScript
import { RgbColors } from "../Colors";
export class CropMark {
constructor() {
this.name = "cropmark";
this.margin = 10;
this.color = RgbColors.black;
this.widthPx = 1;
this.length = 8;
this.leftNotes = null;
this.topNotes = null;
this.rightNotes = null;
this.bottomNotes = null;
}
get margins() {
if (typeof this.margin === "number")
return { horizontal: this.margin, vertical: this.margin };
else
return this.margin;
}
get lengths() {
if (typeof this.length === "number")
return { horizontal: this.length, vertical: this.length };
else
return this.length;
}
clone() {
const clone = new CropMark();
clone.name = this.name;
clone.margin = this.margin;
clone.color = this.color;
clone.widthPx = this.widthPx;
clone.length = this.length;
clone.leftNotes = this.leftNotes != null ? this.leftNotes.map(n => n.clone()) : null;
clone.topNotes = this.topNotes != null ? this.topNotes.map(n => n.clone()) : null;
clone.rightNotes = this.rightNotes != null ? this.rightNotes.map(n => n.clone()) : null;
clone.bottomNotes = this.bottomNotes != null ? this.bottomNotes.map(n => n.clone()) : null;
return clone;
}
}
export var CropMarkTextAlignment;
(function (CropMarkTextAlignment) {
CropMarkTextAlignment[CropMarkTextAlignment["Left"] = 0] = "Left";
CropMarkTextAlignment[CropMarkTextAlignment["Center"] = 1] = "Center";
CropMarkTextAlignment[CropMarkTextAlignment["Right"] = 2] = "Right";
})(CropMarkTextAlignment || (CropMarkTextAlignment = {}));
export class CropMarkText {
constructor() {
this.alignment = CropMarkTextAlignment.Left;
this.fontSize = 3;
this.edgeMargin = 0.3;
this.markMargin = 0.3;
}
clone() {
const clone = new CropMarkText();
clone.alignment = this.alignment;
clone.fontSize = this.fontSize;
clone.text = this.text;
clone.edgeMargin = this.edgeMargin;
clone.markMargin = this.markMargin;
return clone;
}
}
//# sourceMappingURL=CropMark.js.map