diff --git a/Packages/Qt_widget/demo/Qt_widget/Min_ellipse_2/Qt_widget_move_list_point.h b/Packages/Qt_widget/demo/Qt_widget/Min_ellipse_2/Qt_widget_move_list_point.h index 6d1cc1c5d93..e5167b437bc 100644 --- a/Packages/Qt_widget/demo/Qt_widget/Min_ellipse_2/Qt_widget_move_list_point.h +++ b/Packages/Qt_widget/demo/Qt_widget/Min_ellipse_2/Qt_widget_move_list_point.h @@ -53,13 +53,13 @@ class Qt_widget_move_list_point : public Qt_widget_movepoint_helper public: typedef typename R::Point_2 Point; typedef typename R::FT FT; - bool on_first, //if the user choosed something from the popup - wasrepainted;//true when the widget was repainted - Point old_point, //the last point stored in the list - current_v; //the current point - QPopupMenu *popup1; - QCursor cursor; - std::list* l_of_p; + bool on_first, //if the user choosed something from the popup + wasrepainted;//true when the widget was repainted + Point old_point, //the last point stored in the list + current_v; //the current point + QPopupMenu *popup1; + QCursor cursor; + std::list* l_of_p; bool first_time; //constructor @@ -86,25 +86,26 @@ private: { if(l_of_p->empty()) QMessageBox::warning( widget, "There are no points in the list!", - "Generate some points first or add it with the input tool before using this tool!"); + "Generate some points first or add it with the + input tool before using this tool!"); else{ FT x=static_cast(widget->x_real(e->x())); - FT y=static_cast(widget->y_real(e->y())); + FT y=static_cast(widget->y_real(e->y())); Point p(x, y); - Point closest_p; //this point is the closest one to the mouse coordinates + Point closest_p; + //this point is the closest one to the mouse coordinates FT min_dist; std::list::const_iterator it = l_of_p->begin(); min_dist = squared_distance(p, (*it)); + closest_p = (*it); while(it!=l_of_p->end()) { - if (min_dist > squared_distance(p, (*it))) - { - min_dist = squared_distance(p, (*it)); - closest_p = (*it); - } - it++; - } - + if (min_dist > squared_distance(p, (*it))) { + min_dist = squared_distance(p, (*it)); + closest_p = (*it); + } + it++; + } RasterOp old = widget->rasterOp(); //save the initial raster mode widget->setRasterOp(XorROP); widget->lock(); @@ -125,11 +126,10 @@ private: { if(on_first) { - FT - x=static_cast(widget->x_real(e->x())), - y=static_cast(widget->y_real(e->y())); - - *widget << CGAL::GREEN << CGAL::PointSize (5) << CGAL::PointStyle (CGAL::DISC); + FT x=static_cast(widget->x_real(e->x())); + FT y=static_cast(widget->y_real(e->y())); + *widget << CGAL::GREEN << CGAL::PointSize (5) + << CGAL::PointStyle (CGAL::DISC); if(!wasrepainted) *widget << old_point; *widget << Point(x, y);