[Lemon-commits] alpar: r3210 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Thu Mar 1 17:03:36 CET 2007


Author: alpar
Date: Thu Mar  1 17:03:36 2007
New Revision: 3210

Modified:
   lemon/trunk/lemon/graph_to_eps.h

Log:
Prescaling can be turned off


Modified: lemon/trunk/lemon/graph_to_eps.h
==============================================================================
--- lemon/trunk/lemon/graph_to_eps.h	(original)
+++ lemon/trunk/lemon/graph_to_eps.h	Thu Mar  1 17:03:36 2007
@@ -134,6 +134,8 @@
   bool _absoluteEdgeWidths;
 
   bool _negY;
+
+  bool _preScale;
   ///Constructor
 
   ///Constructor
@@ -163,7 +165,8 @@
     _autoEdgeWidthScale(false),
     _absoluteNodeSizes(false),
     _absoluteEdgeWidths(false),
-    _negY(false)
+    _negY(false),
+    _preScale(true)
   {}
 };
 
@@ -239,6 +242,7 @@
 
 
   using T::_negY;
+  using T::_preScale;
 
   // dradnats ++C eht yb deriuqer si ti eveileb t'naC
 
@@ -521,6 +525,16 @@
     _negY=b;return *this;
   }
 
+  ///Turns on/off prescaling
+
+  ///Turns on/off prescaling
+  ///
+  ///\todo More docs.
+  ///
+  GraphToEps<T> &preScale(bool b=true) {
+    _preScale=b;return *this;
+  }
+
   ///Sets a global scale factor for edge widths
 
   /// Sets a global scale factor for edge widths.
@@ -776,10 +790,12 @@
     if(_scaleToA4)
       os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n";
     else {
-      //Rescale so that BoundingBox won't be neither to big nor too small.
-      while(bb.height()*_scale>1000||bb.width()*_scale>1000) _scale/=10;
-      while(bb.height()*_scale<100||bb.width()*_scale<100) _scale*=10;
-    
+      if(_preScale) {
+	//Rescale so that BoundingBox won't be neither to big nor too small.
+	while(bb.height()*_scale>1000||bb.width()*_scale>1000) _scale/=10;
+	while(bb.height()*_scale<100||bb.width()*_scale<100) _scale*=10;
+      }
+      
       os << "%%BoundingBox: "
 	 << int(floor(bb.left()   * _scale - _xBorder)) << ' '
 	 << int(floor(bb.bottom() * _scale - _yBorder)) << ' '



More information about the Lemon-commits mailing list