diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 504f0ee..efc47f8 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -523,18 +523,20 @@ namespace QuickMedia { if(is_touch_enabled()) { const sf::Vector2f mouse_pos_diff(mouse_pos_raw.x - mouse_pos.x, mouse_pos_raw.y - mouse_pos.y); - const float move_speed = 25.0f; + const float move_speed = 35.0f; + sf::Vector2f prev_mouse_pos = mouse_pos; mouse_pos.x += (mouse_pos_diff.x * std::min(1.0f, frame_time * move_speed)); mouse_pos.y += (mouse_pos_diff.y * std::min(1.0f, frame_time * move_speed)); + const sf::Vector2f mouse_pos_diff_smooth = mouse_pos - prev_mouse_pos; sf::Vector2f mouse_pos_raw_diff(mouse_pos_raw.x - prev_mouse_pos_raw.x, mouse_pos_raw.y - prev_mouse_pos_raw.y); prev_mouse_pos_raw = mouse_pos_raw; if(items_cut_off) { if(mouse_left_pressed) { - page_scroll += mouse_pos_raw_diff.y; + page_scroll += mouse_pos_diff_smooth.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); + mouse_scroll_accel *= (float)((double)frame_time * 180.0); } else { page_scroll += mouse_scroll_accel.y; } |