Skip to content

Commit

Permalink
CODE: simplfied
Browse files Browse the repository at this point in the history
  • Loading branch information
arose committed Aug 7, 2015
1 parent 06634c3 commit 13f7e29
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions js/ngl/structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ NGL.BfactorColorMaker = function( params ){

if( !params.domain ){

var bfactor;
var min = Infinity;
var max = -Infinity;

Expand All @@ -1096,8 +1097,9 @@ NGL.BfactorColorMaker = function( params ){

this.structure.eachAtom( function( a ){

min = Math.min( min, a.bfactor );
max = Math.max( max, a.bfactor );
bfactor = a.bfactor;
min = Math.min( min, bfactor );
max = Math.max( max, bfactor );

}, selection );

Expand All @@ -1108,10 +1110,9 @@ NGL.BfactorColorMaker = function( params ){

for( var i = 0; i < n; ++i ){

var a = atoms[ i ];

min = Math.min( min, a.bfactor );
max = Math.max( max, a.bfactor );
bfactor = atoms[ i ].bfactor;
min = Math.min( min, bfactor );
max = Math.max( max, bfactor );

}

Expand Down

0 comments on commit 13f7e29

Please sign in to comment.