mirror of https://github.com/CGAL/cgal
fixed bug in new_window when tr1.number_of_vertices() <= 1
This commit is contained in:
parent
cefb1df112
commit
3c4f2d82d9
|
|
@ -231,19 +231,21 @@ private slots:
|
|||
Window *ed = new Window(500, 500);
|
||||
ed->setCaption("Layer");
|
||||
ed->show();
|
||||
Vertex_iterator it = tr1.vertices_begin();
|
||||
xmin = xmax = (*it).point().x();
|
||||
ymin = ymax = (*it).point().y();
|
||||
while(it != tr1.vertices_end()) {
|
||||
if(xmin > (*it).point().x())
|
||||
xmin = (*it).point().x();
|
||||
if(xmax < (*it).point().x())
|
||||
xmax = (*it).point().x();
|
||||
if(ymin > (*it).point().y())
|
||||
ymin = (*it).point().y();
|
||||
if(ymax < (*it).point().y())
|
||||
ymax = (*it).point().y();
|
||||
it++;
|
||||
if(tr1.number_of_vertices() > 1){
|
||||
Vertex_iterator it = tr1.vertices_begin();
|
||||
xmin = xmax = (*it).point().x();
|
||||
ymin = ymax = (*it).point().y();
|
||||
while(it != tr1.vertices_end()) {
|
||||
if(xmin > (*it).point().x())
|
||||
xmin = (*it).point().x();
|
||||
if(xmax < (*it).point().x())
|
||||
xmax = (*it).point().x();
|
||||
if(ymin > (*it).point().y())
|
||||
ymin = (*it).point().y();
|
||||
if(ymax < (*it).point().y())
|
||||
ymax = (*it).point().y();
|
||||
it++;
|
||||
}
|
||||
}
|
||||
ed->set_window(xmin, xmax, ymin, ymax);
|
||||
something_changed();
|
||||
|
|
|
|||
Loading…
Reference in New Issue