diff --git a/source/gui/widgets/treebox.cpp b/source/gui/widgets/treebox.cpp index 30739d1c..195f6900 100644 --- a/source/gui/widgets/treebox.cpp +++ b/source/gui/widgets/treebox.cpp @@ -643,16 +643,11 @@ namespace nana { auto const short_side = (std::min)(pos, last_pos - pos); if (short_side >= capacity / 2) - { - pos = short_side - capacity / 2; - } + pos -= capacity / 2; + else if (short_side == pos || (last_pos + 1 < capacity)) + pos = 0; else - { - if (short_side == pos || (last_pos + 1 < capacity)) - pos = 0; - else - pos = last_pos + 1 - capacity; - } + pos = last_pos + 1 - capacity; } else if (align_v::bottom == bearing) {