Public feed
#726097
RCS file: /cvsroot/pcb/pcb/src/hid/gtk/gtkhid-main.c,v
retrieving revision 1.45
diff -u -2 -r1.45 gtkhid-main.c
--- hid/gtk/gtkhid-main.c 12 Sep 2007 21:53:27 -0000 1.45
+++ hid/gtk/gtkhid-main.c 4 Oct 2007 21:42:46 -0000
@@ -1173,15 +1173,24 @@
* need_idle_proc ();
*/
- if ( (x < gport->view_x0) ||
- (x > gport->view_x0 + gport->view_width) ||
- (y < gport->view_y0) ||
- (y > gport->view_y0 + gport->view_height) )
+
+#if 0
+printf("(x,y) = (%d, %d)\n", x, y);
+printf("(Sx,Sy) = (%d, %d)\n", SIDE_X(x), SIDE_Y(y));
+printf("(x0,y0) = (%d, %d)\n", gport->view_x0, gport->view_y0);
+printf("(w,h) = (%d, %d)\n", gport->view_width, gport->view_height);
+#endif
+
+ if ( (SIDE_X (x) < gport->view_x0) ||
+ (SIDE_X (x) > gport->view_x0 + gport->view_width) ||
+ (SIDE_Y (y) < gport->view_y0) ||
+ (SIDE_Y (y) > gport->view_y0 + gport->view_height) )
{
- gport->view_x0 = x - gport->view_width / 2;
- gport->view_y0 = y - gport->view_height / 2;
+ gport->view_x0 = SIDE_X (x) - gport->view_width / 2;
+ gport->view_y0 = SIDE_Y (y) - gport->view_height / 2;
ghid_pan_fixup ();
}
}
+return;
/*
* Pan the viewport so that the crosshair (which is in a fixed