fix bug that treebox.scroll_into_view() generated a wrong position
This commit is contained in:
@@ -643,17 +643,12 @@ namespace nana
|
|||||||
{
|
{
|
||||||
auto const short_side = (std::min)(pos, last_pos - pos);
|
auto const short_side = (std::min)(pos, last_pos - pos);
|
||||||
if (short_side >= capacity / 2)
|
if (short_side >= capacity / 2)
|
||||||
{
|
pos -= capacity / 2;
|
||||||
pos = short_side - capacity / 2;
|
else if (short_side == pos || (last_pos + 1 < capacity))
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (short_side == pos || (last_pos + 1 < capacity))
|
|
||||||
pos = 0;
|
pos = 0;
|
||||||
else
|
else
|
||||||
pos = last_pos + 1 - capacity;
|
pos = last_pos + 1 - capacity;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (align_v::bottom == bearing)
|
else if (align_v::bottom == bearing)
|
||||||
{
|
{
|
||||||
if (pos + 1 >= capacity)
|
if (pos + 1 >= capacity)
|
||||||
|
|||||||
Reference in New Issue
Block a user