tablet: split sanitize_tablet_axes up into two helpers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-12-15 08:39:56 +10:00
parent 67e0b232a0
commit 0319ee1d33

View file

@ -957,7 +957,7 @@ tablet_notify_buttons(struct tablet_dispatch *tablet,
}
static void
sanitize_tablet_axes(struct tablet_dispatch *tablet)
sanitize_pressure_distance(struct tablet_dispatch *tablet)
{
bool tool_in_contact;
const struct input_absinfo *distance,
@ -995,7 +995,11 @@ sanitize_tablet_axes(struct tablet_dispatch *tablet)
else
tablet->axes[LIBINPUT_TABLET_TOOL_AXIS_PRESSURE] = 0;
}
}
static inline void
sanitize_mouse_lens_rotation(struct tablet_dispatch *tablet)
{
/* If we have a mouse/lens cursor and the tilt changed, the rotation
changed. Mark this, calculate the angle later */
if ((tablet->current_tool_type == LIBINPUT_TABLET_TOOL_TYPE_MOUSE ||
@ -1011,6 +1015,13 @@ axis_range_percentage(const struct input_absinfo *a, int percent)
return (a->maximum - a->minimum) * percent/100 + a->minimum;
}
static void
sanitize_tablet_axes(struct tablet_dispatch *tablet)
{
sanitize_pressure_distance(tablet);
sanitize_mouse_lens_rotation(tablet);
}
static void
detect_pressure_offset(struct tablet_dispatch *tablet,
struct evdev_device *device,