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; }