I got the zoom info struct from code as above, but I'm puzzled on the relation ship between "zoom" and "radius".
/** * @struct _Elm_Gesture_Zoom_Info * @brief The structure type that holds zoom info for the user. */ struct _Elm_Gesture_Zoom_Info { Evas_Coord x, y; /**< Holds zoom center point reported to the user */ Evas_Coord radius; /**< Holds radius between fingers reported to the user */ double zoom; /**< Zoom value: @c 1.0 means no zoom */ double momentum; /**< Zoom momentum: zoom growth per second (NOT YET SUPPORTED) */ }; /** * @typedef Elm_Gesture_Zoom_Info * @brief The structure type that holds zoom info for the user. */ typedef struct _Elm_Gesture_Zoom_Info Elm_Gesture_Zoom_Info;
Below are my codes to output zhe zoom info data when zoom event comes.
static Evas_Event_Flags zoom_start_cb(void *data , void *event_info) { Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *)event_info; dlog_print(DLOG_ERROR, "zoom_start_cb", "Zoom info (x,y,radius,zoom,momentum) = (%d, %d, %d, %lf, %lf)", p->x, p->y, p->radius, p->zoom, p->momentum); return EVAS_EVENT_FLAG_ON_HOLD; } static Evas_Event_Flags zoom_move_cb(void *data , void *event_info) { Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *)event_info; dlog_print(DLOG_ERROR, "zoom_move_cb", "Zoom info (x,y,radius,zoom,momentum) = (%d, %d, %d, %lf, %lf)", p->x, p->y, p->radius, p->zoom, p->momentum); return EVAS_EVENT_FLAG_ON_HOLD; } static Evas_Event_Flags zoom_end_cb(void *data , void *event_info) { Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *)event_info; dlog_print(DLOG_ERROR, "zoom_end_cb", "Zoom info (x,y,radius,zoom,momentum) = (%d, %d, %d, %lf, %lf)", p->x, p->y, p->radius, p->zoom, p->momentum); return EVAS_EVENT_FLAG_ON_HOLD; } static Evas_Event_Flags zoom_abort_cb(void *data , void *event_info) { Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *)event_info; dlog_print(DLOG_ERROR, "zoom_abort_cb", "Zoom info (x,y,radius,zoom,momentum) = (%d, %d, %d, %lf, %lf)", p->x, p->y, p->radius, p->zoom, p->momentum); return EVAS_EVENT_FLAG_ON_HOLD; }
I got the log as below.
I find the zoom value does not proportional growth with raidus. What's the exact relationship between them? What are the exact geometric meaning for radius and zoom when two finger do zoom action on the screen? How the zoom value is caculated? How the raidus value is caculated?