]> sigrok.org Git - pulseview.git/commitdiff
CursorHeader: Hit test time items from front to back
authorJoel Holdsworth <redacted>
Sat, 13 Dec 2014 16:24:26 +0000 (16:24 +0000)
committerJoel Holdsworth <redacted>
Sun, 28 Dec 2014 18:52:53 +0000 (18:52 +0000)
pv/view/cursorheader.cpp

index 2683e9e6b20c8fc10c9d81f5bfd10dadb14f95fa..fbc6e2e791d53eccf26140896fae83291f607714 100644 (file)
@@ -114,9 +114,9 @@ void CursorHeader::mousePressEvent(QMouseEvent *e)
                clear_selection();
 
                const vector< shared_ptr<TimeItem> > items(view_.time_items());
-               for (auto &i : items)
-                       if (i && i->label_rect(rect()).contains(e->pos())) {
-                               mouse_down_item_ = i;
+               for (auto i = items.rbegin(); i != items.rend(); i++)
+                       if ((*i)->label_rect(rect()).contains(e->pos())) {
+                               mouse_down_item_ = (*i);
                                break;
                        }