fix bug that treebox scroll_into_view wrongly calcuates a position

This commit is contained in:
Jinhao 2018-09-19 22:37:24 +08:00
parent 361bcbc81f
commit 284a153be0

View File

@ -644,7 +644,7 @@ namespace nana
auto const short_side = (std::min)(pos, last_pos - pos);
if (short_side >= capacity / 2)
{
pos -= short_side;
pos = short_side - capacity / 2;
}
else
{
@ -665,6 +665,9 @@ namespace nana
auto prv_first = shape.first;
shape.first = attr.tree_cont.advance_if(nullptr, pos, drawerbase::treebox::pred_allow_child{});
//Update the position of scroll
show_scroll();
return has_expanded || (prv_first != shape.first);
}