diff --git a/packages/core/src/state/StateSystem.js b/packages/core/src/state/StateSystem.js index c7e35d2..f3be34e 100755 --- a/packages/core/src/state/StateSystem.js +++ b/packages/core/src/state/StateSystem.js @@ -182,6 +182,8 @@ */ setOffset(value) { + this.updateCheck(StateSystem.checkPolygonOffset, value); + this.gl[value ? 'enable' : 'disable'](this.gl.POLYGON_OFFSET_FILL); } @@ -314,5 +316,16 @@ system.setBlendMode(state.blendMode); } - // TODO - add polygon offset? + /** + * A private little wrapper function that we call to check the polygon offset. + * + * @static + * @private + * @param {PIXI.StateSystem} System the System to perform the state check on + * @param {PIXI.State} state the state that the blendMode will pulled from + */ + static checkPolygonOffset(system, state) + { + system.setPolygonOffset(state.polygonOffset, 0); + } }