UNPKG

@pixi/core

Version:
65 lines (60 loc) 1.63 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var constants = require('@pixi/constants'); var Filter = require('../filters/Filter.js'); class MaskData { constructor(maskObject = null) { this.type = constants.MASK_TYPES.NONE; this.autoDetect = true; this.maskObject = maskObject || null; this.pooled = false; this.isMaskData = true; this.resolution = null; this.multisample = Filter.Filter.defaultMultisample; this.enabled = true; this.colorMask = 15; this._filters = null; this._stencilCounter = 0; this._scissorCounter = 0; this._scissorRect = null; this._scissorRectLocal = null; this._colorMask = 15; this._target = null; } get filter() { return this._filters ? this._filters[0] : null; } set filter(value) { if (value) { if (this._filters) { this._filters[0] = value; } else { this._filters = [value]; } } else { this._filters = null; } } reset() { if (this.pooled) { this.maskObject = null; this.type = constants.MASK_TYPES.NONE; this.autoDetect = true; } this._target = null; this._scissorRectLocal = null; } copyCountersOrReset(maskAbove) { if (maskAbove) { this._stencilCounter = maskAbove._stencilCounter; this._scissorCounter = maskAbove._scissorCounter; this._scissorRect = maskAbove._scissorRect; } else { this._stencilCounter = 0; this._scissorCounter = 0; this._scissorRect = null; } } } exports.MaskData = MaskData; //# sourceMappingURL=MaskData.js.map