diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index ea38d98b..c2d75048 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -3433,6 +3433,8 @@ namespace nana rect.y - static_cast(origin.y % item_height_px) }; + essence_->inline_buffered_table.swap(essence_->inline_table); + // The first display is empty when the listbox is empty. if (!first_disp.empty()) { @@ -3455,8 +3457,6 @@ namespace nana auto idx = first_disp; - essence_->inline_buffered_table.swap(essence_->inline_table); - for (auto & cat : lister.cat_container()) for (auto & ind : cat.indicators) { @@ -3526,10 +3526,10 @@ namespace nana ++idx.item; } } - - essence_->inline_buffered_table.clear(); } + essence_->inline_buffered_table.clear(); + if (item_coord.y < rect.bottom()) { rectangle bground_r{ rect.x, item_coord.y, rect.width, static_cast(rect.bottom() - item_coord.y) };