diff --git a/dlib/gui_widgets/widgets.cpp b/dlib/gui_widgets/widgets.cpp index 7806dab11..c9e175019 100644 --- a/dlib/gui_widgets/widgets.cpp +++ b/dlib/gui_widgets/widgets.cpp @@ -6375,8 +6375,8 @@ namespace dlib for (unsigned long i = 0; i < overlay_lines.size(); ++i) { draw_line(c, - zoom_in_scale*overlay_lines[i].p1/zoom_out_scale + origin, - zoom_in_scale*overlay_lines[i].p2/zoom_out_scale + origin, + zoom_in_scale*(overlay_lines[i].p1+dpoint(0.5,0.5))/zoom_out_scale + origin, + zoom_in_scale*(overlay_lines[i].p2+dpoint(0.5,0.5))/zoom_out_scale + origin, overlay_lines[i].color, area); } diff --git a/dlib/gui_widgets/widgets.h b/dlib/gui_widgets/widgets.h index 79aa81552..c6e60a6e4 100644 --- a/dlib/gui_widgets/widgets.h +++ b/dlib/gui_widgets/widgets.h @@ -3337,11 +3337,11 @@ namespace dlib overlay_line() { assign_pixel(color, 0);} template - overlay_line(const point& p1_, const point& p2_, pixel_type p) + overlay_line(const dpoint& p1_, const dpoint& p2_, pixel_type p) : p1(p1_), p2(p2_) { assign_pixel(color, p); } - point p1; - point p2; + dpoint p1; + dpoint p2; rgb_alpha_pixel color; }; diff --git a/dlib/gui_widgets/widgets_abstract.h b/dlib/gui_widgets/widgets_abstract.h index 210d5e082..d5fc5118d 100644 --- a/dlib/gui_widgets/widgets_abstract.h +++ b/dlib/gui_widgets/widgets_abstract.h @@ -2489,8 +2489,8 @@ namespace dlib its two end points (p1 and p2) as well as a color. !*/ - point p1; - point p2; + dpoint p1; + dpoint p2; rgb_alpha_pixel color; overlay_line( @@ -2504,8 +2504,8 @@ namespace dlib template overlay_line( - const point& p1_, - const point& p2_, + const dpoint& p1_, + const dpoint& p2_, pixel_type p ); /*!