Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 7518) +++ trunk/src/obj_poly.c (revision 7519) @@ -748,29 +748,6 @@ 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 7518) +++ trunk/src/obj_poly_draw.h (revision 7519) @@ -33,7 +33,3 @@ 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); Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 7518) +++ trunk/src/obj_text.c (revision 7519) @@ -502,6 +502,32 @@ /*** draw ***/ +#define MAX_SIMPLE_POLY_POINTS 256 +static void draw_text_poly(pcb_text_t *Text, pcb_polygon_t *poly, pcb_coord_t x0) +{ + 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; + } + + /* transform each coordinate */ + for(n = 0, p = poly->Points; n < max; n++,p++) { + x[n] = PCB_SCALE_TEXT(p->X + x0, Text->Scale); + y[n] = PCB_SCALE_TEXT(p->Y, Text->Scale); + PCB_COORD_ROTATE90(x[n], y[n], 0, 0, Text->Direction); + x[n] += Text->X; + y[n] += Text->Y; + } + + pcb_gui->fill_polygon(Output.fgGC, poly->PointN, x, y); +} + + /* --------------------------------------------------------------------------- * lowlevel drawing routine for text objects */ @@ -551,7 +577,7 @@ /* draw the polygons */ for(p = polylist_first(&font->Symbol[*string].polys); p != NULL; p = polylist_next(p)) - _draw_simple_poly(p); + draw_text_poly(Text, p, x); /* move on to next cursor position */ x += (font->Symbol[*string].Width + font->Symbol[*string].Delta);