From d4ee29216cfbd37cff37d02efbf0ed5179745376 Mon Sep 17 00:00:00 2001 From: Tristan VALCKE Date: Mon, 23 Jan 2017 22:02:34 +0100 Subject: [PATCH] Fix Material accessors --- src/materials/Material.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/materials/Material.js b/src/materials/Material.js index 7d4c9bf03d..a692878625 100644 --- a/src/materials/Material.js +++ b/src/materials/Material.js @@ -63,24 +63,27 @@ function Material() { } -Object.assign( Material.prototype, EventDispatcher.prototype, { - - constructor: Material, - - isMaterial: true, +Object.defineProperty( Material.prototype, "needsUpdate", { - get needsUpdate() { + get: function() { return this._needsUpdate; }, - - set needsUpdate( value ) { + set: function(value) { if ( value === true ) this.update(); this._needsUpdate = value; - }, + } + +}); + +Object.assign( Material.prototype, EventDispatcher.prototype, { + + constructor: Material, + + isMaterial: true, setValues: function ( values ) { -- GitLab