lemon/graph_to_eps.h
changeset 1570 da93692e6537
parent 1494 ae55ba000ebb
child 1573 b76a0af36f44
equal deleted inserted replaced
2:7349192a82d0 3:5f3ff6eb1c8b
   705       ctime_r(&tv.tv_sec,cbuf);
   705       ctime_r(&tv.tv_sec,cbuf);
   706       os << "%%CreationDate: " << cbuf;
   706       os << "%%CreationDate: " << cbuf;
   707     }
   707     }
   708     BoundingBox<double> bb;
   708     BoundingBox<double> bb;
   709     ///\bug: Chech whether the graph is empty.
   709     ///\bug: Chech whether the graph is empty.
   710     if(NodeIt(g)==INVALID) bb+=xy<double>(0,0);
       
   711     for(NodeIt n(g);n!=INVALID;++n) {
   710     for(NodeIt n(g);n!=INVALID;++n) {
   712       double ns=_nodeSizes[n]*_nodeScale;
   711       double ns=_nodeSizes[n]*_nodeScale;
   713       xy<double> p(ns,ns);
   712       xy<double> p(ns,ns);
   714       bb+=p+_coords[n];
   713       bb+=p+_coords[n];
   715       bb+=-p+_coords[n];
   714       bb+=-p+_coords[n];
   716       }
   715     }
       
   716     if (bb.empty()) {
       
   717       bb = BoundingBox<double>(xy<double>(0,0));
       
   718     }
   717     if(_scaleToA4)
   719     if(_scaleToA4)
   718       os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n";
   720       os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n";
   719     else os << "%%BoundingBox: "
   721     else os << "%%BoundingBox: "
   720 	    << bb.left()*  _scale-_xBorder << ' '
   722 	    << bb.left()*  _scale-_xBorder << ' '
   721 	    << bb.bottom()*_scale-_yBorder << ' '
   723 	    << bb.bottom()*_scale-_yBorder << ' '