From dfc39fdb812376213d430f6f1a07e6b9fae773b6 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Fri, 17 Jun 2016 02:41:09 +0800 Subject: [PATCH] fix a bug of listbox's header column_from_point --- source/gui/widgets/listbox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index f01c3e90..ced6fe24 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -688,14 +688,13 @@ namespace nana { if (col.visible_state) { + if (x < static_cast(col.width_px)) + return col.index; + x -= static_cast(col.width_px); continue; } - - if (x < static_cast(col.width_px)) - return col.index; } - return npos; }