[gnome-control-center] wacom: Don't use monitor geometry X/Y when calculating calibration



commit e2464ee773eb2744d0e8c606fb6fbb5a0c3198c1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Nov 29 16:39:33 2013 +0100

    wacom: Don't use monitor geometry X/Y when calculating calibration
    
    Calibration must be performed based on the device w/h ranges and the
    screen size, so in which coordinates the monitor is virtually mapped
    matters little on device coordinates. This fixes calibration of devices
    attached to a monitor elsewhere than (0,0) in the screen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719574

 panels/wacom/calibrator/calibrator.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/panels/wacom/calibrator/calibrator.c b/panels/wacom/calibrator/calibrator.c
index a9acb49..d94fedb 100644
--- a/panels/wacom/calibrator/calibrator.c
+++ b/panels/wacom/calibrator/calibrator.c
@@ -149,11 +149,11 @@ finish (struct Calib *c,
     /* Compute min/max coordinates. */
     /* These are scaled using the values of old_axis */
     scale_x = (c->old_axis.x_max - c->old_axis.x_min)/(float)c->geometry.width;
-    axis.x_min = ((((c->clicked_x[UL] + c->clicked_x[LL]) / 2) - c->geometry.x) * scale_x) + 
c->old_axis.x_min;
-    axis.x_max = ((((c->clicked_x[UR] + c->clicked_x[LR]) / 2) - c->geometry.x) * scale_x) + 
c->old_axis.x_min;
+    axis.x_min = ((((c->clicked_x[UL] + c->clicked_x[LL]) / 2)) * scale_x) + c->old_axis.x_min;
+    axis.x_max = ((((c->clicked_x[UR] + c->clicked_x[LR]) / 2)) * scale_x) + c->old_axis.x_min;
     scale_y = (c->old_axis.y_max - c->old_axis.y_min)/(float)c->geometry.height;
-    axis.y_min = ((((c->clicked_y[UL] + c->clicked_y[UR]) / 2) - c->geometry.y) * scale_y) + 
c->old_axis.y_min;
-    axis.y_max = ((((c->clicked_y[LL] + c->clicked_y[LR]) / 2) - c->geometry.y) * scale_y) + 
c->old_axis.y_min;
+    axis.y_min = ((((c->clicked_y[UL] + c->clicked_y[UR]) / 2)) * scale_y) + c->old_axis.y_min;
+    axis.y_max = ((((c->clicked_y[LL] + c->clicked_y[LR]) / 2)) * scale_y) + c->old_axis.y_min;
 
     /* Add/subtract the offset that comes from not having the points in the
      * corners (using the same coordinate system they are currently in)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]