all files / barcode/rendering/ renderer.js

100% Statements 19/19
100% Branches 2/2
100% Functions 6/6
100% Lines 19/19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27   2188× 2188× 2188× 2188×   727× 727×   3132145× 3132145×   728× 728×        
define(["require", "exports", "./canvas-renderer", "./svg-renderer"], function (require, exports, canvas_renderer_1, svg_renderer_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var BarcodeRenderer = (function () {
        function BarcodeRenderer(name, isSvgMode) {
            this.renderer = null;
            this.isSvgMode = null;
            this.isSvgMode = isSvgMode;
            this.renderer = isSvgMode ? new svg_renderer_1.BarcodeSVGRenderering() : new canvas_renderer_1.BarcodeCanvasRenderer();
        }
        BarcodeRenderer.prototype.renderRootElement = function (attribute, backGroundColor, width, height) {
            var canvasObj = this.renderer.renderRootElement(attribute, backGroundColor, width, height);
            return canvasObj;
        };
        BarcodeRenderer.prototype.renderRectElement = function (canvas, attribute) {
            var canvasObj = this.renderer.renderRect(canvas, attribute);
            return canvasObj;
        };
        BarcodeRenderer.prototype.renderTextElement = function (canvas, attribute) {
            var canvasObj = this.renderer.renderText(canvas, attribute);
            return canvasObj;
        };
        return BarcodeRenderer;
    }());
    exports.BarcodeRenderer = BarcodeRenderer;
});