diff options
Diffstat (limited to 'src/grail-inserter.c')
| -rw-r--r-- | src/grail-inserter.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/grail-inserter.c b/src/grail-inserter.c index f784848..ab81ece 100644 --- a/src/grail-inserter.c +++ b/src/grail-inserter.c | |||
| @@ -104,11 +104,6 @@ int gin_init(struct grail *ge) | |||
| 104 | return -ENOMEM; | 104 | return -ENOMEM; |
| 105 | for (i = 0; i < DIM_INSTANCE; i++) | 105 | for (i = 0; i < DIM_INSTANCE; i++) |
| 106 | grail_mask_set(gin->unused, i); | 106 | grail_mask_set(gin->unused, i); |
| 107 | gin->scale_x = 1; | ||
| 108 | gin->scale_y = 1; | ||
| 109 | gin->scale_r = 1; | ||
| 110 | gin->trans_x = 1; | ||
| 111 | gin->trans_y = 1; | ||
| 112 | ge->gin = gin; | 107 | ge->gin = gin; |
| 113 | return 0; | 108 | return 0; |
| 114 | } | 109 | } |
| @@ -298,17 +293,12 @@ void grail_set_bbox(struct grail *ge, | |||
| 298 | const struct grail_coord *tmax) | 293 | const struct grail_coord *tmax) |
| 299 | { | 294 | { |
| 300 | struct utouch_surface *s = utouch_frame_get_surface(ge->impl->fh); | 295 | struct utouch_surface *s = utouch_frame_get_surface(ge->impl->fh); |
| 301 | struct gesture_inserter *gin = ge->gin; | 296 | |
| 302 | double tx, ty, dx, dy, sx, sy; | 297 | s->mapped_min_x = tmin->x; |
| 303 | tx = tmax->x - tmin->x; | 298 | s->mapped_min_y = tmin->y; |
| 304 | ty = tmax->y - tmin->y; | 299 | s->mapped_max_x = tmax->x; |
| 305 | dx = s->max_x - s->min_x; | 300 | s->mapped_max_y = tmax->y; |
| 306 | dy = s->max_y - s->min_y; | 301 | |
| 307 | sx = tx / dx; | 302 | if (ge->gru) |
| 308 | sy = ty / dy; | 303 | gru_init_motion(ge); |
| 309 | gin->scale_x = sx; | ||
| 310 | gin->scale_y = sy; | ||
| 311 | gin->scale_r = sqrt((tx * tx + ty * ty) / (dx * dx + dy * dy)); | ||
| 312 | gin->trans_x = tmin->x - s->min_x * sx; | ||
| 313 | gin->trans_y = tmin->y - s->min_y * sy; | ||
| 314 | } | 304 | } |
