/** * Created by W.X. on 2016/11/18. */ import {Unit} from "../../../drawing/Unit"; export class Padding { private _paddingTop: Unit; private _paddingLeft: Unit; private _paddingBottom: Unit; private _paddingRight: Unit; constructor(top = Unit.pixel(0), right = Unit.pixel(0), bottom = Unit.pixel(0), left = Unit.pixel(0)) { this._paddingTop = top; this._paddingRight = right; this._paddingBottom = bottom; this._paddingLeft = left; } clone() { return new Padding( this._paddingTop.clone(), this._paddingRight.clone(), this._paddingBottom.clone(), this._paddingLeft.clone() ); } setPadding(value: Unit): void { this.top = value; this.left = value; this.bottom = value; this.right = value; } get top(): Unit { return this._paddingTop; } set top(value: Unit) { this._paddingTop = value; } get left(): Unit { return this._paddingLeft; } set left(value: Unit) { this._paddingLeft = value; } get bottom(): Unit { return this._paddingBottom; } set bottom(value: Unit) { this._paddingBottom = value; } get right(): Unit { return this._paddingRight; } set right(value: Unit) { this._paddingRight = value; } }