Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
ydist *= tp->buttons.motion_dist.y_scale_coeff;
/* 3mm movement -> unpin */
- if (vector_length(xdist, ydist) >= 3.0) {
+ if (hypot(xdist, ydist) >= 3.0) {
t->pinned.is_pinned = false;
return;
}
double parse_trackpoint_accel_property(const char *prop);
bool parse_dimension_property(const char *prop, size_t *width, size_t *height);
-static inline double
-vector_length(double x, double y)
-{
- return sqrt(x * x + y * y);
-}
-
#endif /* LIBINPUT_UTIL_H */
ck_assert((evx == 0.0) == (dx == 0));
ck_assert((evy == 0.0) == (dy == 0));
- len = vector_length(evx, evy);
+ len = hypot(evx, evy);
ck_assert(fabs(len) >= 0.3);
libinput_event_destroy(event);