[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (351ebc91665795f98d0e6c6676d0c85c7e464008)
The branch, master has been updated
via 351ebc91665795f98d0e6c6676d0c85c7e464008 (commit)
from c2e0a8593ff4a04f96fa216282b5542d957203a7 (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/draw.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
=================
Commit Messages
=================
commit 351ebc91665795f98d0e6c6676d0c85c7e464008
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Remove clip_box global variable in favour of a more targeted one
Used for polygon clipping during drawing.
:100644 100644 2273d76... 8e8821d... M src/draw.c
=========
Changes
=========
commit 351ebc91665795f98d0e6c6676d0c85c7e464008
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Remove clip_box global variable in favour of a more targeted one
Used for polygon clipping during drawing.
diff --git a/src/draw.c b/src/draw.c
index 2273d76..8e8821d 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -77,7 +77,6 @@ static BoxType Block = {MAXINT, MAXINT, -MAXINT, -MAXINT};
static int doing_pinout = 0;
static bool doing_assy = false;
-static const BoxType *clip_box = NULL;
/* ---------------------------------------------------------------------------
* some local prototypes
@@ -860,10 +859,15 @@ clearPin_callback (const BoxType * b, void *cl)
return 1;
}
+struct poly_info {
+ const BoxType *drawn_area;
+ LayerType *layer;
+};
+
static int
poly_callback (const BoxType * b, void *cl)
{
- LayerType *layer = cl;
+ struct poly_info *i = cl;
PolygonType *polygon = (PolygonType *)b;
static char *color;
@@ -871,19 +875,19 @@ poly_callback (const BoxType * b, void *cl)
return 0;
if (TEST_FLAG (SELECTEDFLAG, polygon))
- color = layer->SelectedColor;
+ color = i->layer->SelectedColor;
else if (TEST_FLAG (FOUNDFLAG, polygon))
color = PCB->ConnectedColor;
else
- color = layer->Color;
+ color = i->layer->Color;
gui->set_color (Output.fgGC, color);
if (gui->thindraw_pcb_polygon != NULL &&
(TEST_FLAG (THINDRAWFLAG, PCB) ||
TEST_FLAG (THINDRAWPOLYFLAG, PCB)))
- gui->thindraw_pcb_polygon (Output.fgGC, polygon, clip_box);
+ gui->thindraw_pcb_polygon (Output.fgGC, polygon, i->drawn_area);
else
- gui->fill_pcb_polygon (Output.fgGC, polygon, clip_box);
+ gui->fill_pcb_polygon (Output.fgGC, polygon, i->drawn_area);
/* If checking planes, thin-draw any pieces which have been clipped away */
if (gui->thindraw_pcb_polygon != NULL &&
@@ -895,7 +899,7 @@ poly_callback (const BoxType * b, void *cl)
for (poly.Clipped = polygon->Clipped->f;
poly.Clipped != polygon->Clipped;
poly.Clipped = poly.Clipped->f)
- gui->thindraw_pcb_polygon (Output.fgGC, &poly, clip_box);
+ gui->thindraw_pcb_polygon (Output.fgGC, &poly, i->drawn_area);
}
return 1;
@@ -1063,9 +1067,10 @@ text_callback (const BoxType * b, void *cl)
void
DrawLayerCommon (LayerTypePtr Layer, const BoxType * screen, bool clear_pins)
{
+ struct poly_info info = {screen, Layer};
+
/* print the non-clearing polys */
- clip_box = screen;
- r_search (Layer->polygon_tree, screen, NULL, poly_callback, Layer);
+ r_search (Layer->polygon_tree, screen, NULL, poly_callback, &info);
if (clear_pins && TEST_FLAG (CHECKPLANESFLAG, PCB))
return;
@@ -1092,8 +1097,6 @@ DrawLayerCommon (LayerTypePtr Layer, const BoxType * screen, bool clear_pins)
0, 0,
PCB->MaxWidth, PCB->MaxHeight);
}
-
- clip_box = NULL;
}
void
@@ -1115,7 +1118,6 @@ DrawLayerGroup (int group, const BoxType *drawn_area)
int n_entries = PCB->LayerGroups.Number[group];
Cardinal *layers = PCB->LayerGroups.Entries[group];
- clip_box = drawn_area;
for (i = n_entries - 1; i >= 0; i--)
{
layernum = layers[i];
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs