From 7c8b9828a3c2f1b9319d2515cb7b8669c5b84824 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 17 Jul 2015 19:41:33 -0400 Subject: [PATCH] Fixed the image_display so that when you try to click on boxes that happen to have object parts labeled with OBJECT_PART_NOT_PRESENT it doesn't accidentally move that non-present part rather than what you are clicking on. --- dlib/gui_widgets/widgets.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlib/gui_widgets/widgets.cpp b/dlib/gui_widgets/widgets.cpp index 1b5c523d1..f124316ca 100644 --- a/dlib/gui_widgets/widgets.cpp +++ b/dlib/gui_widgets/widgets.cpp @@ -6312,6 +6312,9 @@ namespace dlib std::map::const_iterator itr; for (itr = overlay_rects[i].parts.begin(); itr != overlay_rects[i].parts.end(); ++itr) { + if (itr->second == OBJECT_PART_NOT_PRESENT) + continue; + rectangle temp = centered_rect(get_rect_on_screen(centered_rect(itr->second,1,1)), part_width, part_width); if (rect_is_selected && selected_rect == i && @@ -6504,6 +6507,9 @@ namespace dlib std::map::const_iterator itr; for (itr = overlay_rects[i].parts.begin(); itr != overlay_rects[i].parts.end(); ++itr) { + if (itr->second == OBJECT_PART_NOT_PRESENT) + continue; + rectangle temp = centered_rect(get_rect_on_screen(centered_rect(itr->second,1,1)), part_width, part_width); point c = center(temp); @@ -6647,6 +6653,9 @@ namespace dlib std::map::const_iterator itr; for (itr = overlay_rects[i].parts.begin(); itr != overlay_rects[i].parts.end(); ++itr) { + if (itr->second == OBJECT_PART_NOT_PRESENT) + continue; + rectangle temp = centered_rect(get_rect_on_screen(centered_rect(itr->second,1,1)), part_width, part_width); point c = center(temp);