[clutter] device-manager-xi2: Fix scaling of coordinates
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] device-manager-xi2: Fix scaling of coordinates
- Date: Fri, 9 Jan 2015 11:43:50 +0000 (UTC)
commit 9660b001f7ee410bcbff545989a708b103e6faaf
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Fri Jan 9 05:06:32 2015 -0500
device-manager-xi2: Fix scaling of coordinates
Do not CLAMP to width/height before applying the scale factor
we will lose all information we need to scale properly.
https://bugzilla.gnome.org/show_bug.cgi?id=730815
clutter/x11/clutter-device-manager-xi2.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
index 223e875..47aa4bf 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -660,8 +660,8 @@ translate_coords (ClutterStageX11 *stage_x11,
clutter_actor_get_size (stage, &stage_width, &stage_height);
- *x_out = CLAMP (event_x, 0, stage_width) / stage_x11->scale_factor;
- *y_out = CLAMP (event_y, 0, stage_height) / stage_x11->scale_factor;
+ *x_out = CLAMP (event_x / stage_x11->scale_factor, 0, stage_width);
+ *y_out = CLAMP (event_y / stage_x11->scale_factor, 0, stage_height);
}
static gdouble
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]