device-manager-xi2: Don't divide by the scale factor twice

The coordinates we pass into translate_axes are already scaled.
This commit is contained in:
Jasper St. Pierre 2013-10-07 11:56:15 -04:00 committed by Emmanuele Bassi
parent 354c3c7977
commit 1de024b5fa

View File

@ -602,7 +602,6 @@ static gdouble *
translate_axes (ClutterInputDevice *device, translate_axes (ClutterInputDevice *device,
gdouble x, gdouble x,
gdouble y, gdouble y,
ClutterStageX11 *stage_x11,
XIValuatorState *valuators) XIValuatorState *valuators)
{ {
guint n_axes = clutter_input_device_get_n_axes (device); guint n_axes = clutter_input_device_get_n_axes (device);
@ -627,11 +626,11 @@ translate_axes (ClutterInputDevice *device,
switch (axis) switch (axis)
{ {
case CLUTTER_INPUT_AXIS_X: case CLUTTER_INPUT_AXIS_X:
retval[i] = x / stage_x11->scale_factor; retval[i] = x;
break; break;
case CLUTTER_INPUT_AXIS_Y: case CLUTTER_INPUT_AXIS_Y:
retval[i] = y / stage_x11->scale_factor; retval[i] = y;
break; break;
default: default:
@ -946,7 +945,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->scroll.axes = translate_axes (event->scroll.device, event->scroll.axes = translate_axes (event->scroll.device,
event->scroll.x, event->scroll.x,
event->scroll.y, event->scroll.y,
stage_x11,
&xev->valuators); &xev->valuators);
CLUTTER_NOTE (EVENT, CLUTTER_NOTE (EVENT,
@ -995,7 +993,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->button.axes = translate_axes (event->button.device, event->button.axes = translate_axes (event->button.device,
event->button.x, event->button.x,
event->button.y, event->button.y,
stage_x11,
&xev->valuators); &xev->valuators);
CLUTTER_NOTE (EVENT, CLUTTER_NOTE (EVENT,
@ -1106,7 +1103,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->motion.axes = translate_axes (event->motion.device, event->motion.axes = translate_axes (event->motion.device,
event->motion.x, event->motion.x,
event->motion.y, event->motion.y,
stage_x11,
&xev->valuators); &xev->valuators);
if (source_device != NULL && device->stage != NULL) if (source_device != NULL && device->stage != NULL)
@ -1161,7 +1157,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->touch.axes = translate_axes (event->touch.device, event->touch.axes = translate_axes (event->touch.device,
event->motion.x, event->motion.x,
event->motion.y, event->motion.y,
stage_x11,
&xev->valuators); &xev->valuators);
if (xi_event->evtype == XI_TouchBegin) if (xi_event->evtype == XI_TouchBegin)
@ -1213,7 +1208,6 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->touch.axes = translate_axes (event->touch.device, event->touch.axes = translate_axes (event->touch.device,
event->motion.x, event->motion.x,
event->motion.y, event->motion.y,
stage_x11,
&xev->valuators); &xev->valuators);
_clutter_input_device_xi2_translate_state (event, _clutter_input_device_xi2_translate_state (event,