src/glRenderer.cc

changeset 737
e58bdb21cc54
parent 733
cc39df788660
child 738
16b63398aa1f
--- a/src/glRenderer.cc	Sun Apr 27 03:53:57 2014 +0300
+++ b/src/glRenderer.cc	Sun Apr 27 04:06:46 2014 +0300
@@ -229,7 +229,6 @@
 	rot (X) = 30.0f;
 	rot (Y) = 325.f;
 	pan (X) = pan (Y) = rot (Z) = 0.0f;
-	zoomToFit();
 }
 
 // =============================================================================
@@ -363,6 +362,12 @@
 	if (document() == null)
 		return;
 
+	if (currentDocumentData().needZoomToFit)
+	{
+		currentDocumentData().needZoomToFit = false;
+		zoomAllToFit();
+	}
+
 	if (gl_wireframe && not isPicking())
 		glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
@@ -1366,6 +1371,8 @@
 			resetAllAngles();
 			currentDocumentData().init = true;
 		}
+
+		currentDocumentData().needZoomToFit = true;
 	}
 }
 

mercurial