diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-26 08:18:00 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-26 08:18:00 +0200 |
commit | c3bc6fbd7f4fffff90b40f813418b0dbd030bbd2 (patch) | |
tree | 4ee4b493f94e662c3590cbd77b2fc88d137b240c /src | |
parent | 1026360c595818eabe75813bcd02258c4d0dddc7 (diff) |
cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 3169b6c..504f0ee 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -161,7 +161,7 @@ namespace QuickMedia { return true; } - bool Body::select_previous_item(bool scroll_page_if_large_item, bool reset_select_scroll) { + bool Body::select_previous_item(bool scroll_page_if_large_item) { if(items.empty()) return false; @@ -190,9 +190,6 @@ namespace QuickMedia { break; } - if(reset_select_scroll) - selected_scrolled = 0.0f; - if(selected_item == new_selected_item) return false; @@ -200,7 +197,7 @@ namespace QuickMedia { return true; } - bool Body::select_next_item(bool scroll_page_if_large_item, bool reset_select_scroll) { + bool Body::select_next_item(bool scroll_page_if_large_item) { if(items.empty()) return false; @@ -229,9 +226,6 @@ namespace QuickMedia { break; } - if(reset_select_scroll) - selected_scrolled = 0.0f; - if(selected_item == new_selected_item) return false; @@ -241,8 +235,6 @@ namespace QuickMedia { void Body::set_selected_item(int item, bool reset_prev_selected_item) { //assert(item >= 0 && item < (int)items.size()); - if(item != selected_item) - selected_scrolled = 0.0f; selected_item = item; clamp_selection(); if(reset_prev_selected_item) @@ -264,7 +256,6 @@ namespace QuickMedia { } void Body::select_first_item() { - selected_scrolled = 0.0f; selected_item = 0; if(attach_side == AttachSide::TOP) { prev_selected_item = selected_item; @@ -278,7 +269,6 @@ namespace QuickMedia { void Body::select_last_item(bool reset_prev_select) { int new_selected_item = std::max(0, (int)items.size() - 1); - selected_scrolled = 0.0f; selected_item = new_selected_item; if(reset_prev_select) prev_selected_item = selected_item; @@ -290,8 +280,6 @@ namespace QuickMedia { } void Body::clear_items() { - if(selected_item != 0) - selected_scrolled = 0.0f; items.clear(); selected_item = 0; prev_selected_item = selected_item; @@ -544,12 +532,10 @@ namespace QuickMedia { if(items_cut_off) { if(mouse_left_pressed) { - selected_scrolled += mouse_pos_raw_diff.y; page_scroll += mouse_pos_raw_diff.y; mouse_scroll_accel = sf::Vector2f(mouse_pos_raw_diff.x, mouse_pos_raw_diff.y); mouse_scroll_accel *= (float)((double)frame_time * 288.0); } else { - selected_scrolled += mouse_scroll_accel.y; page_scroll += mouse_scroll_accel.y; } } @@ -626,8 +612,6 @@ namespace QuickMedia { double scroll_smooth_diff = extra_scroll_current - prev_extra_scroll; prev_extra_scroll = extra_scroll_current; - selected_scrolled += scroll_smooth_diff; - if(body_size_changed) { extra_scroll_current = extra_scroll_target; prev_extra_scroll = extra_scroll_current; @@ -1450,7 +1434,6 @@ namespace QuickMedia { } void Body::set_page_scroll(float scroll) { - selected_scrolled = 0.0f; page_scroll = scroll; clamp_selected_item_to_body_count = 1; } |