From: Joel Holdsworth Date: Sun, 6 Sep 2015 14:30:30 +0000 (-0600) Subject: Header: Hit-test items in reverse order X-Git-Tag: pulseview-0.3.0~74 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=adf3aaf490ad6f04f7a92a5bc01581f3075b1e9e;p=pulseview.git Header: Hit-test items in reverse order --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 58c21e59..bfb75532 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -92,9 +92,9 @@ shared_ptr Header::get_mouse_over_item(const QPoint &pt) const QRect r(0, 0, width() - BaselineOffset, height()); const vector> items( view_.list_by_type()); - for (auto &i : items) - if (i->enabled() && i->label_rect(r).contains(pt)) - return i; + for (auto i = items.rbegin(); i != items.rend(); i++) + if ((*i)->enabled() && (*i)->label_rect(r).contains(pt)) + return *i; return shared_ptr(); }