Skip to content

Commit 8b967fb

Browse files
Mugen87mrdoob
authored andcommitted
GridHelper: Clean up (mrdoob#8959)
1 parent a8c93d4 commit 8b967fb

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

editor/js/Viewport.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,15 @@ var Viewport = function ( editor ) {
283283
switch ( value ) {
284284

285285
case 'css/light.css':
286-
grid.setColors( 0x444444, 0x888888 );
286+
sceneHelpers.remove( grid );
287+
grid = new THREE.GridHelper( 30, 1, 0x444444, 0x888888 );
288+
sceneHelpers.add( grid );
287289
clearColor = 0xaaaaaa;
288290
break;
289291
case 'css/dark.css':
290-
grid.setColors( 0xbbbbbb, 0x888888 );
292+
sceneHelpers.remove( grid );
293+
grid = new THREE.GridHelper( 30, 1, 0xbbbbbb, 0x888888 );
294+
sceneHelpers.add( grid );
291295
clearColor = 0x333333;
292296
break;
293297

editor/js/libs/tern-threejs/threejs.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,11 +1884,7 @@
18841884
"GridHelper": {
18851885
"!url": "http://threejs.org/docs/#Reference/extras/helpers/GridHelper",
18861886
"prototype": {
1887-
"!proto": "THREE.Line.prototype",
1888-
"setColors": {
1889-
"!type": "fn(colorCenterLine: number, colorGrid: number)",
1890-
"!doc": "Updates the color of the grid lines."
1891-
}
1887+
"!proto": "THREE.Line.prototype"
18921888
},
18931889
"!doc": "The GridHelper is an object to define grids. Grids are two-dimensional arrays of lines.",
18941890
"!type": "fn(size: number, step: number)"

examples/webgl_loader_amf.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@
7474

7575
scene.add( camera );
7676

77-
var grid = new THREE.GridHelper( 25, 1.0 );
78-
grid.setColors( 0xffffff, 0x555555 );
77+
var grid = new THREE.GridHelper( 25, 1.0, 0xffffff, 0x555555 );
7978
grid.rotateOnAxis( new THREE.Vector3( 1, 0, 0 ), 90 * ( Math.PI/180 ) );
8079
scene.add( grid );
8180

examples/webgl_loader_fbx.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
scene = new THREE.Scene();
6363

6464
// grid
65-
var gridHelper = new THREE.GridHelper( 14, 1 );
66-
gridHelper.setColors( 0x303030, 0x303030 );
65+
var gridHelper = new THREE.GridHelper( 14, 1, 0x303030, 0x303030 );
6766
gridHelper.position.set( 0, - 0.04, 0 );
6867
scene.add( gridHelper );
6968

0 commit comments

Comments
 (0)