@@ -81,7 +81,7 @@ ruis::event_status flickable::on_mouse_button(const mouse_button_event& event)
8181 utki::assert (event.action == button_action::release, SL);
8282 this ->cur_state = state::inertial_scrolling;
8383
84- this ->velocity = this ->calculate_touch_velocity ();
84+ this ->velocity = this ->calculate_touch_velocity_px_per_ms ();
8585 std::cout << " touch release, vel = " << this ->velocity << std::endl;
8686
8787 this ->touch_history .clear ();
@@ -253,7 +253,7 @@ void flickable::push_touch_move_to_history(touch_move_info tm)
253253 this ->touch_history .push_back (std::move (tm));
254254};
255255
256- ruis::vec2 flickable::calculate_touch_velocity ()
256+ ruis::vec2 flickable::calculate_touch_velocity_px_per_ms ()
257257{
258258 if (this ->touch_history .size () < 2 ) {
259259 // std::cout << "flickable::calculate_touch_velocity(): return 0. this->touch_history.size() = " << this->touch_history.size() << std::endl;
@@ -276,13 +276,13 @@ ruis::vec2 flickable::calculate_touch_velocity()
276276 }
277277
278278 // use Ordinary Least Squares method to fit a quadratic curve to the points of touch history
279- ruis::vec2 vel = calculate_touch_velocity_for_at_least_3_points_using_ols_method ();
279+ ruis::vec2 vel = calculate_touch_velocity_for_at_least_3_points_using_ols_method_px_per_ms ();
280280
281281 // std::cout << "flickable::calculate_touch_velocity(): return " << vel << ". this->touch_history.size() = " << this->touch_history.size() << std::endl;
282282 return vel;
283283}
284284
285- ruis::vec2 flickable::calculate_touch_velocity_for_at_least_3_points_using_ols_method ()
285+ ruis::vec2 flickable::calculate_touch_velocity_for_at_least_3_points_using_ols_method_px_per_ms ()
286286{
287287 // Ordinary Least Squares method fits quadratic curve y(t)=a*t^2+b*t+c to a set of n >= 3 points.
288288 // Coefficients a, b and c can be found by solving the following system of linear equations
0 commit comments