From 8bcfc825801d03a9356beebfd780f4e400e447a4 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sat, 18 Jun 2016 06:42:42 +0800 Subject: [PATCH] fix bug that a listbox column can be a negative by moving splitter --- source/gui/widgets/listbox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 2057b1ac..120fa9f4 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -2911,8 +2911,10 @@ namespace nana { // resize column, not move it auto& col = essence_->header.at(grabs_.splitter); + auto delta_px = (grabs_.start_pos - pos.x); + //Resize the item specified by item_spliter_. - auto new_w = grabs_.item_width - (grabs_.start_pos - pos.x); + auto new_w = static_cast(grabs_.item_width) > delta_px ? grabs_.item_width - delta_px : 0; //Check the minimized and maximized value if (col.range_width_px.first != col.range_width_px.second)