32 static void update_multidrag(
multidrag_t* md,
int group);
44 }
else if (free_index < 0 && !
multidrag_d[i].size) {
57 static void update_multidrag(
multidrag_t* md,
int group) {
59 md->
uid = strokes[group].
uid;
78 calculate_transform(md);
90 float dist =
SQUARE_SUM(strokes[group].x - md->
px[group], strokes[group].y - md->
py[group]);
108 calculate_center(md);
136 md->
px[i] = strokes[i].
x;
138 md->
py[i] = strokes[i].
y;
152 dx[i] = strokes[i].
x - md->
cx;
153 dy[i] = strokes[i].
y - md->
cy;
159 md->
sx[i] = dx[i] / a;
160 md->
sy[i] = dy[i] / a;
180 md->
dx = md->
dx0 + (cx - md->
cx);
181 md->
dy = md->
dy0 + (cy - md->
cy);
188 float dx = strokes[i].
x - cx;
189 float dy = strokes[i].
y - cy;
190 a += md->
sx[i] * dx + md->
sy[i] * dy;
191 b += md->
sx[i] * dy - md->
sy[i] * dx;
const multidrag_t * get_multidrag()
Access array of multidrag_t of size MAX_TOUCHES.
void init_multidrag()
Initialize multidrag data structures.
multidrag_t multidrag_d[MAX_TOUCHES]
void recognize_multidrag(const touch_event_t *event)
Recognize multidrag gesture. This gesture locks the number of fingers once any finger starts moving.
state
This represents the state of individual gesture recognizers.
@ RECOGNIZER_STATE_IN_PROGRESS
@ RECOGNIZER_STATE_FAILED
@ RECOGNIZER_STATE_COMPLETED
@ RECOGNIZER_STATE_POSSIBLE
const stroke_t * get_stroke()
Access array of stroke_t of size MAX_TOUCHES.
Data structure for multidrag gesture data.
char strokes[MAX_TOUCHES]
Data structure for stroke gesture data.
To use the gesture library, users create touch events and fill in the appropriate fields.