fix bug of scroll.make_page_scroll
This commit is contained in:
parent
ebfca14e19
commit
3f7dd3fe3e
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* A Scroll Implementation
|
* A Scroll Implementation
|
||||||
* Nana C++ Library(http://www.nanapro.org)
|
* Nana C++ Library(http://www.nanapro.org)
|
||||||
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
|
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
|
||||||
*
|
*
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
@ -147,7 +147,7 @@ namespace nana
|
|||||||
|
|
||||||
void step(size_type s)
|
void step(size_type s)
|
||||||
{
|
{
|
||||||
metrics_.step = s;
|
metrics_.step = (s ? s : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool make_step(bool forward, unsigned multiple)
|
bool make_step(bool forward, unsigned multiple)
|
||||||
@ -501,7 +501,8 @@ namespace nana
|
|||||||
/// @return true if the vlaue is changed.
|
/// @return true if the vlaue is changed.
|
||||||
bool make_page_scroll(bool forward)
|
bool make_page_scroll(bool forward)
|
||||||
{
|
{
|
||||||
return this->make_step(forward, static_cast<unsigned>(range() - 1));
|
auto const count = range() / step();
|
||||||
|
return this->make_step(forward, (count > 2 ? count - 1 : 1));
|
||||||
}
|
}
|
||||||
};//end class scroll
|
};//end class scroll
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user