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

gEDA-cvs: pcb.git: branch: master updated (be0620e20b85d2d8122383a11fef8646153f7f5d)



The branch, master has been updated
       via  be0620e20b85d2d8122383a11fef8646153f7f5d (commit)
      from  60b0ea93b440c505628429637688e8a9ed6eda43 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/gtkhid-main.c        |    2 +-
 src/hid/gtk/gui-netlist-window.c |   14 +++++++++-----
 src/hid/gtk/gui.h                |    1 +
 3 files changed, 11 insertions(+), 6 deletions(-)


=================
 Commit Messages
=================

commit be0620e20b85d2d8122383a11fef8646153f7f5d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fix warping pointer to correct location from netlist window
    
    We weren't updating the pointer location after having panned the
    connection into the center of the screen.
    
    Also fixes the open-coded panning code to work for flipped views.
    The patch is pretty horrible at best, but appears to fix the issue.
    
    Unfortunately the locical call to use (the "Center" action) cannot be
    made through the generic action code as we need to specify the location
    explicitly. We could perhaps export the Centre action function, or
    refactor it as a wrapper around a helper function which we would then
    export and call.
    
    I aim to eventually rework the GTK HID's coordinate transforms
    (including flipped views), event handling, view panning and pointer
    warping in order to give greater sepeatation between the renderer
    agnostic parts of the HID and the renderer. This will be needed for the
    3D portions of the PCB+GL branch.
    
    It seems most sensible to start refactoring from a state where the
    existing code at least functions correctly (even if it isn't pretty),
    rather than work in fixes as I refactor.

:100644 100644 9fd781c... 8bbf3eb... M	src/hid/gtk/gtkhid-main.c
:100644 100644 ce3e2ff... a5e38d1... M	src/hid/gtk/gui-netlist-window.c
:100644 100644 ba8b601... d2a76ce... M	src/hid/gtk/gui.h

=========
 Changes
=========

commit be0620e20b85d2d8122383a11fef8646153f7f5d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fix warping pointer to correct location from netlist window
    
    We weren't updating the pointer location after having panned the
    connection into the center of the screen.
    
    Also fixes the open-coded panning code to work for flipped views.
    The patch is pretty horrible at best, but appears to fix the issue.
    
    Unfortunately the locical call to use (the "Center" action) cannot be
    made through the generic action code as we need to specify the location
    explicitly. We could perhaps export the Centre action function, or
    refactor it as a wrapper around a helper function which we would then
    export and call.
    
    I aim to eventually rework the GTK HID's coordinate transforms
    (including flipped views), event handling, view panning and pointer
    warping in order to give greater sepeatation between the renderer
    agnostic parts of the HID and the renderer. This will be needed for the
    3D portions of the PCB+GL branch.
    
    It seems most sensible to start refactoring from a state where the
    existing code at least functions correctly (even if it isn't pretty),
    rather than work in fixes as I refactor.

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 9fd781c..8bbf3eb 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -34,7 +34,7 @@ static void zoom_by (double factor, int x, int y);
 int ghid_flip_x = 0, ghid_flip_y = 0;
 
 
-static void
+void
 ghid_pan_fixup ()
 {
 
diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index ce3e2ff..a5e38d1 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -270,11 +270,15 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
 	    || Crosshair.Y < gport->view_y0 + margin
 	    || Crosshair.Y > gport->view_y0 + gport->view_height - margin
 	   )
-		{
-		x0 = Crosshair.X - gport->view_width / 2;
-		y0 = Crosshair.Y - gport->view_height / 2;
-		ghid_port_ranges_pan(x0, y0, FALSE);
-		}
+	  {
+
+	    x0 = SIDE_X (Crosshair.X) - gport->view_width / 2;
+	    y0 = SIDE_Y (Crosshair.Y) - gport->view_height / 2;
+	    gport->view_x0 = x0;
+	    gport->view_y0 = y0;
+	    ghid_pan_fixup ();
+	    gui->set_crosshair (Crosshair.X, Crosshair.Y, HID_SC_WARP_POINTER);
+	  }
 	ghid_screen_update();
 }
 
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index ba8b601..d2a76ce 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -507,6 +507,7 @@ void ghid_invalidate_all ();
 void ghid_show_crosshair (gboolean show);
 
 /* gtkhid-main.c */
+void ghid_pan_fixup (void);
 void ghid_get_coords (const char *msg, int *x, int *y);
 gint PCBChanged (int argc, char **argv, int x, int y);
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs