From: Joel Holdsworth Date: Sat, 13 Dec 2014 16:24:26 +0000 (+0000) Subject: CursorHeader: Hit test time items from front to back X-Git-Tag: pulseview-0.3.0~345 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6364695093dad2ad3bfab9a950cc420e29f24680;p=pulseview.git CursorHeader: Hit test time items from front to back --- diff --git a/pv/view/cursorheader.cpp b/pv/view/cursorheader.cpp index 2683e9e6..fbc6e2e7 100644 --- a/pv/view/cursorheader.cpp +++ b/pv/view/cursorheader.cpp @@ -114,9 +114,9 @@ void CursorHeader::mousePressEvent(QMouseEvent *e) clear_selection(); const vector< shared_ptr > 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; }