diff options
Diffstat (limited to 'src/mtstate.h')
| -rw-r--r-- | src/mtstate.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mtstate.h b/src/mtstate.h index fa297cd..a8feaa4 100644 --- a/src/mtstate.h +++ b/src/mtstate.h | |||
| @@ -44,5 +44,19 @@ void output_mtstate(const struct MTState *s); | |||
| 44 | 44 | ||
| 45 | const struct MTFinger *find_finger(const struct MTState *s, int id); | 45 | const struct MTFinger *find_finger(const struct MTState *s, int id); |
| 46 | 46 | ||
| 47 | |||
| 48 | static inline int center_dist2(const struct MTFinger *a, | ||
| 49 | const struct Capabilities *caps) | ||
| 50 | { | ||
| 51 | return dist2(a->hw.position_x - get_cap_xmid(caps), | ||
| 52 | a->hw.position_y - get_cap_ymid(caps)); | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline int center_maxdist2(const struct Capabilities *caps) | ||
| 56 | { | ||
| 57 | return dist2(caps->abs_position_x.maximum - get_cap_xmid(caps), | ||
| 58 | caps->abs_position_y.maximum - get_cap_ymid(caps)); | ||
| 59 | } | ||
| 60 | |||
| 47 | #endif | 61 | #endif |
| 48 | 62 | ||
