From 85978c168bac98c168cd116cbd514cf3dd0f1452 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 27 Aug 2019 11:00:52 -0700 Subject: [PATCH] Layers: Clean up. --- src/core/Layers.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/Layers.js b/src/core/Layers.js index fabbfaf264..33483282df 100644 --- a/src/core/Layers.js +++ b/src/core/Layers.js @@ -22,33 +22,33 @@ Object.assign( Layers.prototype, { }, - toggle: function ( channel ) { + enableAll: function () { - this.mask ^= 1 << channel | 0; + this.mask = 0xffffffff | 0; }, - disable: function ( channel ) { + toggle: function ( channel ) { - this.mask &= ~ ( 1 << channel | 0 ); + this.mask ^= 1 << channel | 0; }, - test: function ( layers ) { + disable: function ( channel ) { - return ( this.mask & layers.mask ) !== 0; + this.mask &= ~ ( 1 << channel | 0 ); }, - enableAll: function () { + disableAll: function () { - this.mask = 0xffffffff | 0; + this.mask = 0; }, - disableAll: function () { + test: function ( layers ) { - this.mask = 0; + return ( this.mask & layers.mask ) !== 0; } -- GitLab