+ * @param tm_end Recent input event timestamp.
+ * @param zoom_val Current computed zoom value.
+ *
+ * @return zoom momentum
+ *
+ * @ingroup Elm_Gesture_Layer
+ */
+static double
+_zoom_momentum_get(Zoom_Type *st, unsigned int tm_end, double zoom_val)
+{
+ unsigned int tm_total;
+
+ if (st->dir)
+ { /* if direction was already defined, check if changed */
+ if (((st->dir < 0) && (zoom_val > st->info.zoom)) ||
+ ((st->dir > 0) && (zoom_val < st->info.zoom)))
+ { /* Direction changed, reset momentum */
+ st->m_st_tm = 0;
+ st->dir = (-st->dir);
+ }
+ }
+ else
+ st->dir = (zoom_val > st->info.zoom) ? 1 : -1; /* init */
+
+ if (!st->m_st_tm)
+ {
+ st->m_st_tm = tm_end;
+ st->m_base = zoom_val;
+ }
+
+ tm_total = tm_end - st->m_st_tm;
+
+ if (tm_total)
+ return (((zoom_val / st->m_base) - 1.0) * 1000) / tm_total;
+ else
+ return 0.0;
+}
+
+/**
+ * @internal
+ *
+ * This function is used for computing zoom value.
+ *
+ * @param st Pointer to zoom data based on user input.