Merge pull request #11372 from volzhs/fix-smooth-scroll
Fix smooth scrolling in ScrollBar
This commit is contained in:
commit
30ba4076cd
1 changed files with 4 additions and 4 deletions
|
@ -106,9 +106,9 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
|
||||||
if (ofs < grabber_ofs) {
|
if (ofs < grabber_ofs) {
|
||||||
|
|
||||||
if (scrolling) {
|
if (scrolling) {
|
||||||
target_scroll = target_scroll - get_page();
|
target_scroll = CLAMP(target_scroll - get_page(), get_min(), get_max() - get_page());
|
||||||
} else {
|
} else {
|
||||||
target_scroll = get_value() - get_page();
|
target_scroll = CLAMP(get_value() - get_page(), get_min(), get_max() - get_page());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smooth_scroll_enabled) {
|
if (smooth_scroll_enabled) {
|
||||||
|
@ -130,9 +130,9 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
if (scrolling) {
|
if (scrolling) {
|
||||||
target_scroll = target_scroll + get_page();
|
target_scroll = CLAMP(target_scroll + get_page(), get_min(), get_max() - get_page());
|
||||||
} else {
|
} else {
|
||||||
target_scroll = get_value() + get_page();
|
target_scroll = CLAMP(get_value() + get_page(), get_min(), get_max() - get_page());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smooth_scroll_enabled) {
|
if (smooth_scroll_enabled) {
|
||||||
|
|
Loading…
Reference in a new issue