Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 7495) +++ trunk/src/obj_poly.c (revision 7496) @@ -748,6 +748,29 @@ return PCB_R_DIR_FOUND_CONTINUE; } +#define MAX_SIMPLE_POLY_POINTS 128 +void _draw_simple_poly(pcb_polygon_t *poly) +{ + pcb_coord_t x[MAX_SIMPLE_POLY_POINTS], y[MAX_SIMPLE_POLY_POINTS]; + int max, n; + pcb_point_t *p; + + + max = poly->PointN; + if (max > MAX_SIMPLE_POLY_POINTS) { + max = MAX_SIMPLE_POLY_POINTS; + } + + PCB_DRAW_BBOX(poly); + for(n = 0, p = poly->Points; n < max; n++,p++) { + x[n] = p->X; + y[n] = p->Y; + } + + pcb_gui->fill_polygon(Output.fgGC, poly->PointN, x, y); +} + + /* erases a polygon on a layer */ void ErasePolygon(pcb_polygon_t *Polygon) { Index: trunk/src/obj_poly_draw.h =================================================================== --- trunk/src/obj_poly_draw.h (revision 7495) +++ trunk/src/obj_poly_draw.h (revision 7496) @@ -33,3 +33,7 @@ void ErasePolygon(pcb_polygon_t *Polygon); void DrawPolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon); + +/* Draw a simple polygon: no clipping, no hole, just PointN and Points, with + a limited amount of max points */ +void _draw_simple_poly(pcb_polygon_t *poly);