Fix item list scroll speed.

Remove the extra `set_val` action after the proper one, so the right scroll value won’t get overrided any more.
This commit is contained in:
Sean Bohan 2017-05-26 17:25:44 +08:00
parent 29c7118f32
commit 064dce7a4c

View File

@ -521,13 +521,11 @@ void ItemList::_input_event(const InputEvent &p_event) {
scroll_bar->set_val(scroll_bar->get_val() - scroll_bar->get_page() * p_event.mouse_button.factor / 8);
scroll_bar->set_val(scroll_bar->get_val() - scroll_bar->get_page() / 8);
}
if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == BUTTON_WHEEL_DOWN && p_event.mouse_button.pressed) {
scroll_bar->set_val(scroll_bar->get_val() + scroll_bar->get_page() * p_event.mouse_button.factor / 8);
scroll_bar->set_val(scroll_bar->get_val() + scroll_bar->get_page() / 8);
}
if (p_event.is_pressed() && items.size() > 0) {