Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9a2c6a

Browse files
committed
almost there
1 parent 3a64174 commit a9a2c6a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/plots/gl3d/layout/layout_attributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ module.exports = {
7878
role: 'info',
7979
values: ['perspective', 'orthographic'],
8080
dflt: 'perspective',
81-
editType: 'plot',
81+
editType: 'calc',
8282
description: [
8383
'Sets the projection type. The projection type could be',
8484
'either *perspective* or *orthographic*. The default is',
8585
'*perspective*.'
8686
].join(' ')
8787
},
88-
editType: 'plot'
88+
editType: 'calc'
8989
},
9090
editType: 'camera'
9191
},

src/plots/gl3d/scene.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ function initializeGLPlot(scene, camera, canvas, gl) {
248248
*/
249249
if(!success) return showNoWebGlMsg(scene);
250250

251-
252251
var gd = scene.graphDiv;
253252

254253
var relayoutCallback = function(scene) {
@@ -779,11 +778,16 @@ proto.setCamera = function setCamera(cameraData) {
779778
var oldOrtho = this.glplot.camera._ortho;
780779

781780
if(newOrtho !== oldOrtho) {
781+
var RGBA = this.glplot.clearColor;
782+
this.glplot.gl.clearColor(
783+
RGBA[0], RGBA[1], RGBA[2], RGBA[3]
784+
);
785+
this.glplot.gl.clear(
786+
this.glplot.gl.DEPTH_BUFFER_BIT |
787+
this.glplot.gl.COLOR_BUFFER_BIT
788+
);
782789

783790
this.glplot.dispose();
784-
this.glplot = null;
785-
786-
// Need to clear gl-container here
787791

788792
initializeGLPlot(this, cameraData);
789793
this.glplot.camera._ortho = newOrtho;

0 commit comments

Comments
 (0)