all files / graphics/brushes/ pdf-solid-brush.js

82.5% Statements 33/40
88.24% Branches 15/17
76.92% Functions 10/13
81.08% Lines 30/37
11 statements, 6 functions, 9 branches Ignored     
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59          223× 223× 223×                     232×     232× 232×           232× 232× 232× 232×              
/* 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", "./../pdf-color", "./../enum", "./pdf-brush"], function (require, exports, pdf_color_1, enum_1, pdf_brush_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PdfSolidBrush = (function (_super) {
        __extends(PdfSolidBrush, _super);
        function PdfSolidBrush(color) {
            var _this = _super.call(this) || this;
            _this.pdfColor = color;
            return _this;
        }
        Object.defineProperty(PdfSolidBrush.prototype, "color", {
            get: function () {
                return this.pdfColor;
            },
            set: function (value) {
                this.pdfColor = value;
            },
            enumerable: true,
            configurable: true
        });
        PdfSolidBrush.prototype.monitorChanges = function (brush, streamWriter, getResources, saveChanges, currentColorSpace) {
            Iif (streamWriter == null) {
                throw new Error('ArgumentNullException:streamWriter');
            }
            var diff = false;
            Iif (brush == null) {
                diff = true;
                streamWriter.setColorAndSpace(this.pdfColor, currentColorSpace, false);
                return diff;
            }
            else {
                var sBrush = brush;
                diff = true;
                streamWriter.setColorAndSpace(this.pdfColor, currentColorSpace, false);
                return diff;
            }
        };
        PdfSolidBrush.prototype.resetChanges = function (streamWriter) {
            streamWriter.setColorAndSpace(new pdf_color_1.PdfColor(0, 0, 0), enum_1.PdfColorSpace.Rgb, false);
        };
        return PdfSolidBrush;
    }(pdf_brush_1.PdfBrush));
    exports.PdfSolidBrush = PdfSolidBrush;
});