Skip to content

Commit 0ad0c00

Browse files
authored
LineMaterial: Set needsupdate when changing worldUnits property (mrdoob#32952)
1 parent 65697e0 commit 0ad0c00

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

examples/jsm/lines/LineMaterial.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,12 @@ class LineMaterial extends ShaderMaterial {
484484

485485
set worldUnits( value ) {
486486

487+
if ( ( value === true ) !== this.worldUnits ) {
488+
489+
this.needsUpdate = true;
490+
491+
}
492+
487493
if ( value === true ) {
488494

489495
this.defines.WORLD_UNITS = '';

examples/webgl_lines_fat.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@
228228
gui.add( param, 'world units' ).onChange( function ( val ) {
229229

230230
matLine.worldUnits = val;
231-
matLine.needsUpdate = true;
232231

233232
} );
234233

examples/webgl_lines_fat_raycasting.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,7 @@
307307
gui.add( params, 'world units' ).onChange( function ( val ) {
308308

309309
matLine.worldUnits = val;
310-
matLine.needsUpdate = true;
311-
312310
matThresholdLine.worldUnits = val;
313-
matThresholdLine.needsUpdate = true;
314311

315312
} );
316313

0 commit comments

Comments
 (0)