/* istanbul ignore next */
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 __());
};
})();
define(["require", "exports", "./../layout-element", "./shape-layouter"], function (require, exports, layout_element_1, shape_layouter_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var PdfShapeElement = (function (_super) {
__extends(PdfShapeElement, _super);
function PdfShapeElement() {
return _super !== null && _super.apply(this, arguments) || this;
}
PdfShapeElement.prototype.getBounds = function () {
var rect = this.getBoundsInternal();
return rect;
};
PdfShapeElement.prototype.drawGraphicsHelper = function (graphics, location) {
if ((graphics == null)) {
throw new Error('ArgumentNullException :graphics');
}
this.drawShapeHelper(graphics, location.x, location.y);
};
PdfShapeElement.prototype.drawShapeHelper = function (graphics, x, y) {
var bNeedSave = (x !== 0.5 || y !== 0.5);
var gState = null;
if (bNeedSave) {
gState = graphics.save();
graphics.translateTransform(x, y);
}
this.drawInternal(graphics);
if (bNeedSave) {
graphics.restore(gState);
}
};
PdfShapeElement.prototype.layout = function (param) {
var layouter = new shape_layouter_1.ShapeLayouter(this);
var result = layouter.layout(param);
return result;
};
return PdfShapeElement;
}(layout_element_1.PdfLayoutElement));
exports.PdfShapeElement = PdfShapeElement;
});
|