Commit 8b5ee898 authored by Davis King's avatar Davis King

Made overlay_line use dpoints instead of point and also made it render the line

from the middle of the pixel.
parent 92a89bce
...@@ -6375,8 +6375,8 @@ namespace dlib ...@@ -6375,8 +6375,8 @@ namespace dlib
for (unsigned long i = 0; i < overlay_lines.size(); ++i) for (unsigned long i = 0; i < overlay_lines.size(); ++i)
{ {
draw_line(c, draw_line(c,
zoom_in_scale*overlay_lines[i].p1/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/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); overlay_lines[i].color, area);
} }
......
...@@ -3337,11 +3337,11 @@ namespace dlib ...@@ -3337,11 +3337,11 @@ namespace dlib
overlay_line() { assign_pixel(color, 0);} overlay_line() { assign_pixel(color, 0);}
template <typename pixel_type> template <typename pixel_type>
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); } : p1(p1_), p2(p2_) { assign_pixel(color, p); }
point p1; dpoint p1;
point p2; dpoint p2;
rgb_alpha_pixel color; rgb_alpha_pixel color;
}; };
......
...@@ -2489,8 +2489,8 @@ namespace dlib ...@@ -2489,8 +2489,8 @@ namespace dlib
its two end points (p1 and p2) as well as a color. its two end points (p1 and p2) as well as a color.
!*/ !*/
point p1; dpoint p1;
point p2; dpoint p2;
rgb_alpha_pixel color; rgb_alpha_pixel color;
overlay_line( overlay_line(
...@@ -2504,8 +2504,8 @@ namespace dlib ...@@ -2504,8 +2504,8 @@ namespace dlib
template <typename pixel_type> template <typename pixel_type>
overlay_line( overlay_line(
const point& p1_, const dpoint& p1_,
const point& p2_, const dpoint& p2_,
pixel_type p pixel_type p
); );
/*! /*!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment