[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (47e06f69892e9886feda21a04a08e5edd3d74ec2)
The branch, master has been updated
via 47e06f69892e9886feda21a04a08e5edd3d74ec2 (commit)
from faae5572e9742bd0a8a846a9c94963f486c37b5e (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/polygon1.c | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
=================
Commit Messages
=================
commit 47e06f69892e9886feda21a04a08e5edd3d74ec2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
polygon1.c: Tidy up label_contour() following node_label() changes
Since node_label() will now only label the edge following the vertex
passed as its argument, we can simplify label_contour() a little.
By keeping a pointer to the edge where we first start successfully
labelling the polygon, we can avoid having to complete a full loop
around the contour after we've finished labelling.
:100644 100644 8ee6c30... eb4819d... M src/polygon1.c
=========
Changes
=========
commit 47e06f69892e9886feda21a04a08e5edd3d74ec2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
polygon1.c: Tidy up label_contour() following node_label() changes
Since node_label() will now only label the edge following the vertex
passed as its argument, we can simplify label_contour() a little.
By keeping a pointer to the edge where we first start successfully
labelling the polygon, we can avoid having to complete a full loop
around the contour after we've finished labelling.
diff --git a/src/polygon1.c b/src/polygon1.c
index 8ee6c30..eb4819d 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -946,29 +946,27 @@ static BOOLp
label_contour (PLINE * a)
{
VNODE *cur = &a->head;
- int did_label = FALSE, label = UNKNWN;
+ VNODE *first_labelled = NULL;
+ int label = UNKNWN;
do
{
- if (cur == &a->head)
- did_label = FALSE;
- if (NODE_LABEL (cur) != UNKNWN)
- {
- label = NODE_LABEL (cur);
- continue;
- }
if (cur->cvc_next) /* examine cross vertex */
{
label = node_label (cur);
- did_label = TRUE;
- }
- else if (label == INSIDE || label == OUTSIDE)
- {
- LABEL_NODE (cur, label);
- did_label = TRUE;
+ if (first_labelled == NULL)
+ first_labelled = cur;
+ continue;
}
+
+ if (first_labelled == NULL)
+ continue;
+
+ /* This labels nodes which aren't cross-connected */
+ assert (label == INSIDE || label == OUTSIDE);
+ LABEL_NODE (cur, label);
}
- while ((cur = cur->next) != &a->head || did_label);
+ while ((cur = cur->next) != first_labelled);
#ifdef DEBUG_ALL_LABELS
print_labels (a);
DEBUGP ("\n\n");
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs