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

from the middle of the pixel.
This commit is contained in:
Davis King 2018-06-23 13:07:41 -04:00
parent 92a89bceb6
commit 8b5ee898a8
3 changed files with 9 additions and 9 deletions

View File

@ -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);
}

View File

@ -3337,11 +3337,11 @@ namespace dlib
overlay_line() { assign_pixel(color, 0);}
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); }
point p1;
point p2;
dpoint p1;
dpoint p2;
rgb_alpha_pixel color;
};

View File

@ -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 <typename pixel_type>
overlay_line(
const point& p1_,
const point& p2_,
const dpoint& p1_,
const dpoint& p2_,
pixel_type p
);
/*!