diff -r 84d87d6024af -r 92b70deed0c5 lemon/graph_to_eps.h --- a/lemon/graph_to_eps.h Mon Jan 30 09:32:52 2006 +0000 +++ b/lemon/graph_to_eps.h Mon Jan 30 09:37:41 2006 +0000 @@ -851,11 +851,17 @@ if(_scaleToA4) os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n"; - else os << "%%BoundingBox: " - << bb.left() * _scale - _xBorder << ' ' - << bb.bottom() * _scale - _yBorder << ' ' - << bb.right() * _scale + _xBorder << ' ' - << bb.top() * _scale + _yBorder << '\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; + + os << "%%BoundingBox: " + << int(floor(bb.left() * _scale - _xBorder)) << ' ' + << int(floor(bb.bottom() * _scale - _yBorder)) << ' ' + << int(ceil(bb.right() * _scale + _xBorder)) << ' ' + << int(ceil(bb.top() * _scale + _yBorder)) << '\n'; + } os << "%%EndComments\n";