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

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



The branch, master has been updated
       via  eaf012c425a5adc9a31d857d3aa9e906d844c97f (commit)
      from  43060601683a1f87396981db9444fdc29b020f01 (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 |   33 ++++++++++-----------------------
 1 files changed, 10 insertions(+), 23 deletions(-)


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

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

    hid/gtk: Clean up ghid_pan_fixup ()

:100644 100644 ed28ca1... a4cd443... M	src/hid/gtk/gtkhid-main.c

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

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

    hid/gtk: Clean up ghid_pan_fixup ()

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index ed28ca1..a4cd443 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -40,29 +40,16 @@ void
 ghid_pan_fixup ()
 {
 
-  /*
-   * don't pan so far to the right that we see way past the right 
-   * edge of the board.
-   */
-  if (gport->view_x0 > PCB->MaxWidth - gport->view_width)
-    gport->view_x0 = PCB->MaxWidth - gport->view_width;
-
-  /*
-   * don't pan so far down that we see way past the bottom edge of
-   * the board.
-   */
-  if (gport->view_y0 > PCB->MaxHeight - gport->view_height)
-    gport->view_y0 = PCB->MaxHeight - gport->view_height;
-
-  /* don't view above or to the left of the board... ever */
-  if (gport->view_x0 < 0)
-    gport->view_x0 = 0;
+  /* Don't pan so far to the right or bottom that we see past the board edge */
+  gport->view_x0 = MIN (gport->view_x0, PCB->MaxWidth  - gport->view_width);
+  gport->view_y0 = MIN (gport->view_y0, PCB->MaxHeight - gport->view_height);
 
-   if (gport->view_y0 < 0)
-    gport->view_y0 = 0;
+  /* Don't view above or to the left of the board... ever */
+  gport->view_x0 = MAX (0, gport->view_x0);
+  gport->view_y0 = MAX (0, gport->view_y0);
 
-  /* if we can see the entire board and some, then zoom to fit */
-  if (gport->view_width > PCB->MaxWidth &&
+  /* If we can see the entire board and some, then zoom to fit */
+  if (gport->view_width  > PCB->MaxWidth  &&
       gport->view_height > PCB->MaxHeight)
     {
       zoom_fit ();




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