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

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



The branch, master has been updated
       via  9768e060fad7bc3dfc366da76ea1db8154005018 (commit)
      from  ede84819b39e07be001791c243cceacb6d4a61ed (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 |   16 +++++++++++++---
 src/hid/lesstif/main.c    |   10 +++++++++-
 2 files changed, 22 insertions(+), 4 deletions(-)


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

commit 9768e060fad7bc3dfc366da76ea1db8154005018
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix layer visibility logic for some boards.
    
    If the Groups() line listed the c/s layer before the copper layer,
    disabling silk would also disable the copper.  This change searches
    the entire layer group looking for any layer that might need to be
    drawn, and uses that as the exemplar instead of blindly choosing the
    first layer in the list.

:100644 100644 8c3ff67... 58c2635... M	src/hid/gtk/gtkhid-main.c
:100644 100644 3c4ef12... c270992... M	src/hid/lesstif/main.c

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

commit 9768e060fad7bc3dfc366da76ea1db8154005018
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix layer visibility logic for some boards.
    
    If the Groups() line listed the c/s layer before the copper layer,
    disabling silk would also disable the copper.  This change searches
    the entire layer group looking for any layer that might need to be
    drawn, and uses that as the exemplar instead of blindly choosing the
    first layer in the list.

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 8c3ff67..58c2635 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -387,9 +387,19 @@ ghid_invalidate_all ()
 int
 ghid_set_layer (const char *name, int group, int empty)
 {
-  int idx = (group >= 0
-	     && group <
-	     max_layer) ? PCB->LayerGroups.Entries[group][0] : group;
+  int idx = group;
+  if (idx >= 0 && idx < max_layer)
+    {
+      int n = PCB->LayerGroups.Number[group];
+      for (idx = 0; idx < n-1; idx ++)
+	{
+	  int ni = PCB->LayerGroups.Entries[group][idx];
+	  if (ni >= 0 && ni < max_layer + 2
+	      && PCB->Data->Layer[ni].On)
+	    break;
+	}
+      idx = PCB->LayerGroups.Entries[group][idx];
+    }
 
   if (idx >= 0 && idx < max_layer + 2)
     return /*pinout ? 1 : */ PCB->Data->Layer[idx].On;
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 3c4ef12..c270992 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -2814,7 +2814,15 @@ lesstif_set_layer (const char *name, int group, int empty)
   int idx = group;
   if (idx >= 0 && idx < max_layer)
     {
-      idx = PCB->LayerGroups.Entries[idx][0];
+      int n = PCB->LayerGroups.Number[group];
+      for (idx = 0; idx < n-1; idx ++)
+	{
+	  int ni = PCB->LayerGroups.Entries[group][idx];
+	  if (ni >= 0 && ni < max_layer + 2
+	      && PCB->Data->Layer[ni].On)
+	    break;
+	}
+      idx = PCB->LayerGroups.Entries[group][idx];
 #if 0
       if (idx == LayerStack[0]
 	  || GetLayerGroupNumberByNumber (idx) ==




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