Skip to content

Commit

Permalink
Merge pull request #334 from helblazer811/master
Browse files Browse the repository at this point in the history
Bug Fixes
  • Loading branch information
dkoes authored Aug 14, 2017
2 parents c8ccd21 + 63c7885 commit dd6e291
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
3 changes: 2 additions & 1 deletion 3Dmol/WebGL/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,8 @@ $3Dmol.Renderer = function(parameters) {
_currentHeight = _viewportHeight;
this.setViewport();
if (this.autoClear || forceClear) {
_gl.clearColor(_clearColor.r, _clearColor.g, _clearColor.b,
_clearAlpha);
this.clear(this.autoClearColor, this.autoClearDepth,
this.autoClearStencil);

Expand Down Expand Up @@ -1155,7 +1157,6 @@ $3Dmol.Renderer = function(parameters) {

this.setDepthTest(true);
this.setDepthWrite(true);

// _gl.finish();

};
Expand Down
23 changes: 11 additions & 12 deletions 3Dmol/glviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ $3Dmol.GLViewer = (function() {

if(r != row || c != col)
return;

}

var scaleFactor = (CAMERA_Z - rotationGroup.position.z) * 0.85;
Expand Down Expand Up @@ -1207,29 +1206,29 @@ $3Dmol.GLViewer = (function() {
return ret;
};
var spinInterval;
this.spin = function(spin,axis,interval){


spin = spin != undefined ? spin : true;
axis = axis != undefined ? axis : [1,0,0];
interval = interval != undefined ? interval : 50;
this.spin = function(axis){
clearInterval(spinInterval)
if(!spin)
return
if(typeof axis == 'undefined')
axis = 'y';
if(typeof axis == "boolean"){
if(!axis)
return
else
axis = 'y'
}

if(Array.isArray(axis)){
axis = {x:axis[0],y:axis[1],z:axis[2]}
}
//out of bounds check

var viewer = this;


spinInterval = setInterval(
function(){
console.log("rotating")
viewer.rotate(1,axis)
}
,interval);
,25);

}

Expand Down
5 changes: 2 additions & 3 deletions tests/splitviewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@

$3Dmol.download("pdb:1YCR",viewers[0][2],{},function(){
viewers[0][2].setStyle({},{line:{}});
viewers[0][2].spin(true,{x:0,y:1,z:1},50);
viewers[0][2].spin(true,{x:0,y:1,z:1});
viewers[0][2].setBackgroundColor("000000");
viewers[0][2].render();
});

/*
var viewer = $3Dmol.createViewer($("#test38"),{});
$3Dmol.download("pdb:1MO8",viewer,{},function(){
Expand Down

0 comments on commit dd6e291

Please sign in to comment.