fix bug that treebox.scroll_into_view() generated a wrong position

This commit is contained in:
Jinhao 2018-09-21 01:47:34 +08:00
parent 284a153be0
commit bbe2aca483

View File

@ -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)
{