mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Unify ScrollBar/ScrollContainer scroll delta
This commit is contained in:
parent
09ea7bc6a3
commit
b6b3b0e0d6
3 changed files with 18 additions and 16 deletions
|
|
@ -50,13 +50,13 @@ void ScrollBar::gui_input(const Ref<InputEvent> &p_event) {
|
|||
accept_event();
|
||||
|
||||
if (b->get_button_index() == MouseButton::WHEEL_DOWN && b->is_pressed()) {
|
||||
double change = get_page() != 0.0 ? get_page() / 4.0 : (get_max() - get_min()) / 16.0;
|
||||
double change = ((get_page() != 0.0) ? get_page() / PAGE_DIVISOR : (get_max() - get_min()) / 16.0) * b->get_factor();
|
||||
scroll(MAX(change, get_step()));
|
||||
accept_event();
|
||||
}
|
||||
|
||||
if (b->get_button_index() == MouseButton::WHEEL_UP && b->is_pressed()) {
|
||||
double change = get_page() != 0.0 ? get_page() / 4.0 : (get_max() - get_min()) / 16.0;
|
||||
double change = ((get_page() != 0.0) ? get_page() / PAGE_DIVISOR : (get_max() - get_min()) / 16.0) * b->get_factor();
|
||||
scroll(-MAX(change, get_step()));
|
||||
accept_event();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue