Prescaling can be turned off
authoralpar
Thu, 01 Mar 2007 16:03:36 +0000
changeset 2379248152674a9e
parent 2378 c479eab00a18
child 2380 7b0558c52de3
Prescaling can be turned off
lemon/graph_to_eps.h
     1.1 --- a/lemon/graph_to_eps.h	Wed Feb 21 13:51:45 2007 +0000
     1.2 +++ b/lemon/graph_to_eps.h	Thu Mar 01 16:03:36 2007 +0000
     1.3 @@ -134,6 +134,8 @@
     1.4    bool _absoluteEdgeWidths;
     1.5  
     1.6    bool _negY;
     1.7 +
     1.8 +  bool _preScale;
     1.9    ///Constructor
    1.10  
    1.11    ///Constructor
    1.12 @@ -163,7 +165,8 @@
    1.13      _autoEdgeWidthScale(false),
    1.14      _absoluteNodeSizes(false),
    1.15      _absoluteEdgeWidths(false),
    1.16 -    _negY(false)
    1.17 +    _negY(false),
    1.18 +    _preScale(true)
    1.19    {}
    1.20  };
    1.21  
    1.22 @@ -239,6 +242,7 @@
    1.23  
    1.24  
    1.25    using T::_negY;
    1.26 +  using T::_preScale;
    1.27  
    1.28    // dradnats ++C eht yb deriuqer si ti eveileb t'naC
    1.29  
    1.30 @@ -521,6 +525,16 @@
    1.31      _negY=b;return *this;
    1.32    }
    1.33  
    1.34 +  ///Turns on/off prescaling
    1.35 +
    1.36 +  ///Turns on/off prescaling
    1.37 +  ///
    1.38 +  ///\todo More docs.
    1.39 +  ///
    1.40 +  GraphToEps<T> &preScale(bool b=true) {
    1.41 +    _preScale=b;return *this;
    1.42 +  }
    1.43 +
    1.44    ///Sets a global scale factor for edge widths
    1.45  
    1.46    /// Sets a global scale factor for edge widths.
    1.47 @@ -776,10 +790,12 @@
    1.48      if(_scaleToA4)
    1.49        os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n";
    1.50      else {
    1.51 -      //Rescale so that BoundingBox won't be neither to big nor too small.
    1.52 -      while(bb.height()*_scale>1000||bb.width()*_scale>1000) _scale/=10;
    1.53 -      while(bb.height()*_scale<100||bb.width()*_scale<100) _scale*=10;
    1.54 -    
    1.55 +      if(_preScale) {
    1.56 +	//Rescale so that BoundingBox won't be neither to big nor too small.
    1.57 +	while(bb.height()*_scale>1000||bb.width()*_scale>1000) _scale/=10;
    1.58 +	while(bb.height()*_scale<100||bb.width()*_scale<100) _scale*=10;
    1.59 +      }
    1.60 +      
    1.61        os << "%%BoundingBox: "
    1.62  	 << int(floor(bb.left()   * _scale - _xBorder)) << ' '
    1.63  	 << int(floor(bb.bottom() * _scale - _yBorder)) << ' '