From fa24b280c55e5b815c65fe5d30566d036ba9761e Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 24 Jul 2018 08:49:32 +0800 Subject: [PATCH] fix bug that listbox hovered is not working(#328) --- source/gui/widgets/listbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 8a1462af..589a4846 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -2934,9 +2934,9 @@ namespace nana cat_proxy(ess_, pos.cat).at(pos.item).select(true); } - void hovered(index_type /*pos*/) override + void hovered(index_type pos) override { - auto offset = ess_->content_view->origin().y / ess_->item_height(); + auto offset = ess_->lister.distance(ess_->first_display(), ess_->lister.index_cast(pos, false)); if (ess_->pointer_where.first != parts::list || ess_->pointer_where.second != offset) {