From f160710c9222f0de4433a2555edba6dbe4f2525a Mon Sep 17 00:00:00 2001 From: Jinhao Date: Fri, 14 Jul 2017 07:49:16 +0800 Subject: [PATCH] fix bug that scroll() wouldn't work when avoid_drawing --- source/gui/widgets/listbox.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 4a23a9f0..6685f828 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -2849,6 +2849,12 @@ namespace nana this->expand(pos.cat, true); ess_->calc_content_size(); } + else if (!ess_->auto_draw) + { + //force a update of content size and scrollbar status when auto_draw is false to make + //sure that the scroll function works fine. + ess_->calc_content_size(); + } auto origin = ess_->content_view->origin(); origin.y = 0;