Commit 12f6520c authored by Davis King's avatar Davis King

Added another add_overlay() overload to perspective_window and also fixed a

rendering problem in perspective_display that appeared when drawing lines on
displays that weren't positioned at the upper left corner of the entire window.
parent 80ea9c66
......@@ -5811,7 +5811,10 @@ namespace dlib
for (unsigned long i = 0; i < overlay_lines.size(); ++i)
{
draw_line(c, tform(overlay_lines[i].p1), tform(overlay_lines[i].p2), overlay_lines[i].color, area);
draw_line(c, tform(overlay_lines[i].p1)+rect.tl_corner(),
tform(overlay_lines[i].p2)+rect.tl_corner(),
overlay_lines[i].color,
area);
}
}
......
......@@ -3735,6 +3735,7 @@ namespace dlib
) : disp(*this)
{
set_size(100,100);
on_window_resized();
show();
}
......@@ -3744,6 +3745,7 @@ namespace dlib
disp(*this)
{
set_size(100,100);
on_window_resized();
add_overlay(point_cloud);
show();
}
......@@ -3755,6 +3757,7 @@ namespace dlib
disp(*this)
{
set_size(100,100);
on_window_resized();
add_overlay(point_cloud);
set_title(title);
show();
......@@ -3789,6 +3792,12 @@ namespace dlib
disp.clear_overlay();
}
template <typename pixel_type>
void add_overlay(const vector<double>& p1, const vector<double>& p2, pixel_type p)
{
add_overlay(std::vector<overlay_line>(1,overlay_line(p1,p2,p)));
}
void add_overlay(const std::vector<dlib::vector<double> >& d)
{
add_overlay(d, 255);
......@@ -3831,6 +3840,7 @@ namespace dlib
drawable_window::on_window_resized();
unsigned long width, height;
get_size(width,height);
disp.set_pos(0,0);
disp.set_size(width, height);
}
......
......@@ -3398,6 +3398,17 @@ namespace dlib
displayed. They will be colored by pixel color p.
!*/
template <typename pixel_type>
void add_overlay(
const vector<double>& p1,
const vector<double>& p2,
pixel_type color
);
/*!
ensures
- Adds an overlay line going from p1 to p2 with the given color.
!*/
template < typename T >
void set_dot_double_clicked_handler (
T& object,
......
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