@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.
38 lines • 1.68 kB
JavaScript
// ReSharper disable InconsistentNaming
import { EqualsOfFloatNumbers } from "../../Math/Common";
export class ParagraphSettings {
constructor(object) {
this.FirstLineIndent = 0;
this.SpaceAfter = 0;
this.SpaceBefore = 0;
this.LeftIndent = 0;
this.RightIndent = 0;
if (object != null) {
this.FirstLineIndent = (typeof object.FirstLineIndent == "number") ? object.FirstLineIndent : 0;
this.SpaceAfter = (typeof object.SpaceAfter == "number") ? object.SpaceAfter : 0;
this.SpaceBefore = (typeof object.SpaceBefore == "number") ? object.SpaceBefore : 0;
this.LeftIndent = (typeof object.LeftIndent == "number") ? object.LeftIndent : 0;
this.RightIndent = (typeof object.RightIndent == "number") ? object.RightIndent : 0;
}
}
equals(settings) {
return settings instanceof ParagraphSettings &&
EqualsOfFloatNumbers(this.FirstLineIndent, settings.FirstLineIndent) &&
EqualsOfFloatNumbers(this.SpaceAfter, settings.SpaceAfter) &&
EqualsOfFloatNumbers(this.SpaceBefore, settings.SpaceBefore) &&
EqualsOfFloatNumbers(this.LeftIndent, settings.LeftIndent) &&
EqualsOfFloatNumbers(this.RightIndent, settings.RightIndent);
}
static equals(a, b) {
if (a == null && b == null)
return true;
if (a == null || b == null)
return false;
return a.equals(b);
}
clone() {
return new ParagraphSettings(this);
}
}
// ReSharper restore InconsistentNaming
//# sourceMappingURL=ParagraphSettings.js.map