@@ -529,6 +529,7 @@ JSC3D.Viewer.prototype.replaceScene = function(scene) {
529529JSC3D . Viewer . prototype . resetScene = function ( ) {
530530 var d = ( ! this . scene || this . scene . isEmpty ( ) ) ? 0 : this . scene . aabb . lengthOfDiagonal ( ) ;
531531 this . zoomFactor = ( d == 0 ) ? 1 : ( this . frameWidth < this . frameHeight ? this . frameWidth : this . frameHeight ) / d ;
532+ this . minZoomFactor = this . zoomFactor / 10
532533 this . panning = [ 0 , 0 ] ;
533534 this . rotMatrix . identity ( ) ;
534535 this . rotMatrix . rotateAboutXAxis ( this . initRotX ) ;
@@ -1108,6 +1109,7 @@ JSC3D.Viewer.prototype.setupScene = function(scene) {
11081109 var w = this . frameWidth ;
11091110 var h = this . frameHeight ;
11101111 this . zoomFactor = ( d == 0 ) ? 1 : ( w < h ? w : h ) / d ;
1112+ this . minZoomFactor = this . zoomFactor / 10 ;
11111113 this . panning = [ 0 , 0 ] ;
11121114 }
11131115
@@ -1464,8 +1466,8 @@ JSC3D.Viewer.prototype.render = function() {
14641466 if ( this . scene . isEmpty ( ) )
14651467 return ;
14661468
1467- if ( this . zoomFactor < .1 ) {
1468- this . zoomFactor = .1 ;
1469+ if ( this . zoomFactor < this . minZoomFactor ) {
1470+ this . zoomFactor = this . minZoomFactor ;
14691471 }
14701472
14711473 var aabb = this . scene . aabb ;
@@ -5762,4 +5764,4 @@ JSC3D.StlLoader.prototype.onprogress = null;
57625764JSC3D . StlLoader . prototype . onresource = null ;
57635765JSC3D . StlLoader . prototype . decimalPrecision = 3 ;
57645766
5765- JSC3D . LoaderSelector . registerLoader ( 'stl' , JSC3D . StlLoader ) ;
5767+ JSC3D . LoaderSelector . registerLoader ( 'stl' , JSC3D . StlLoader ) ;
0 commit comments