From f20c73129fac507c3577556452a7e2338620883e Mon Sep 17 00:00:00 2001 From: kmribti Date: Mon, 25 Jan 2016 08:26:27 +0100 Subject: [PATCH] Update toolbar.cpp --- source/gui/widgets/toolbar.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/gui/widgets/toolbar.cpp b/source/gui/widgets/toolbar.cpp index 0ec8f642..c509f1a0 100644 --- a/source/gui/widgets/toolbar.cpp +++ b/source/gui/widgets/toolbar.cpp @@ -387,13 +387,10 @@ namespace nana std::size_t index = 0; for(auto m: impl_->items.container()) { - auto px = static_cast(m ? m->pixels : 3); - - if(pos.x < px) + unsigned x = static_cast(pos.x); + if (m && x >= m->position && x <= (m->position+m->pixels)) return (((!m) || (!m->enable && !want_if_disabled)) ? npos : index); - pos.x -= px; - ++index; } return npos;