fill=solid in addition to fill=1 (stippled fill) or fill=0 (no fill) for rectangles, polygon/beziers and circles

This commit is contained in:
stefan schippers 2024-03-09 03:12:25 +01:00
parent 414274f4a3
commit 218d4ad3f2
10 changed files with 156 additions and 71 deletions

View File

@ -3263,7 +3263,7 @@ void new_rect(int what, double mousex_snap, double mousey_snap)
save_draw = xctx->draw_window;
xctx->draw_window = 1;
/* draw fill pattern even in xcopyarea mode */
filledrect(xctx->rectcolor, NOW, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2);
filledrect(xctx->rectcolor, NOW, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2, 1);
xctx->draw_window = save_draw;
storeobject(-1, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2,xRECT,xctx->rectcolor, 0, NULL);
modified = 1;

View File

@ -662,7 +662,7 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot,
{
RECTORDER(x1,y1,x2,y2);
drawrect(c,what, x0+x1, y0+y1, x0+x2, y0+y2, dash);
if(rect->fill) filledrect(c,what, x0+x1, y0+y1, x0+x2, y0+y2);
if(rect->fill) filledrect(c,what, x0+x1, y0+y1, x0+x2, y0+y2, rect->fill);
}
}
}
@ -1449,6 +1449,7 @@ void drawarc(int c, int what, double x, double y, double r, double a, double b,
static XArc xarc[CADDRAWBUFFERSIZE];
double x1, y1, x2, y2; /* arc bbox */
double xx1, yy1, xx2, yy2; /* complete circle bbox in screen coords */
GC gc;
if(arc_fill || dash) what = NOW;
@ -1513,13 +1514,16 @@ void drawarc(int c, int what, double x, double y, double r, double a, double b,
(int)(xx2-xx1), (int)(yy2-yy1), (int)(a*64), (int)(b*64));
}
if(xctx->fill_pattern && xctx->fill_type[c]){
if(xctx->fill_pattern && (xctx->fill_type[c] || arc_fill == 3) ){
if(arc_fill & 2) gc = xctx->gc[c];
else gc = xctx->gcstipple[c];
if(arc_fill) {
if(xctx->draw_window)
XFillArc(display, xctx->window, xctx->gcstipple[c], (int)xx1, (int)yy1,
XFillArc(display, xctx->window, gc, (int)xx1, (int)yy1,
(int)(xx2-xx1), (int)(yy2-yy1), (int)(a*64), (int)(b*64));
if(xctx->draw_pixmap)
XFillArc(display, xctx->save_pixmap, xctx->gcstipple[c], (int)xx1, (int)yy1,
XFillArc(display, xctx->save_pixmap, gc, (int)xx1, (int)yy1,
(int)(xx2-xx1), (int)(yy2-yy1), (int)(a*64), (int)(b*64));
}
}
@ -1536,14 +1540,28 @@ void drawarc(int c, int what, double x, double y, double r, double a, double b,
}
}
void filledrect(int c, int what, double rectx1,double recty1,double rectx2,double recty2)
void filledrect(int c, int what, double rectx1,double recty1,double rectx2,double recty2, int fill)
{
static int i=0;
static XRectangle r[CADDRAWBUFFERSIZE];
static int iif = 0, iis = 0;
int *i;
static XRectangle rf[CADDRAWBUFFERSIZE]; /* full fill */
static XRectangle rs[CADDRAWBUFFERSIZE]; /* stippled fill */
XRectangle *r;
double x1,y1,x2,y2;
GC gc;
if(!has_x) return;
if(!xctx->fill_pattern || !xctx->fill_type[c]) return;
if(!xctx->fill_pattern) return;
if(fill != 3 && !xctx->fill_type[c]) return;
if(fill == 3) { /* full fill */
gc = xctx->gc[c];
r = rf;
i = &iif;
} else { /* stippled fill */
gc = xctx->gcstipple[c];
r = rs;
i = &iis;
}
if(what & NOW)
{
x1=X_TO_SCREEN(rectx1);
@ -1553,23 +1571,23 @@ void filledrect(int c, int what, double rectx1,double recty1,double rectx2,doubl
if(!xctx->only_probes && (x2-x1)< 3.0 && (y2-y1)< 3.0) return;
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&x1,&y1,&x2,&y2) )
{
if(xctx->draw_window) XFillRectangle(display, xctx->window, xctx->gcstipple[c], (int)x1, (int)y1,
if(xctx->draw_window) XFillRectangle(display, xctx->window, gc, (int)x1, (int)y1,
(unsigned int)x2 - (unsigned int)x1,
(unsigned int)y2 - (unsigned int)y1);
if(xctx->draw_pixmap)
XFillRectangle(display, xctx->save_pixmap,xctx->gcstipple[c], (int)x1, (int)y1,
XFillRectangle(display, xctx->save_pixmap, gc, (int)x1, (int)y1,
(unsigned int)x2 - (unsigned int)x1,
(unsigned int)y2 - (unsigned int)y1);
}
}
else if(what & ADD)
{
if(i>=CADDRAWBUFFERSIZE)
if(*i >= CADDRAWBUFFERSIZE)
{
if(xctx->draw_window) XFillRectangles(display, xctx->window, xctx->gcstipple[c], r,i);
if(xctx->draw_window) XFillRectangles(display, xctx->window, gc, r, *i);
if(xctx->draw_pixmap)
XFillRectangles(display, xctx->save_pixmap, xctx->gcstipple[c], r,i);
i=0;
XFillRectangles(display, xctx->save_pixmap, gc, r, *i);
*i=0;
}
x1=X_TO_SCREEN(rectx1);
y1=Y_TO_SCREEN(recty1);
@ -1578,18 +1596,26 @@ void filledrect(int c, int what, double rectx1,double recty1,double rectx2,doubl
if(!xctx->only_probes && (x2-x1)< 3.0 && (y2-y1)< 3.0) return;
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&x1,&y1,&x2,&y2) )
{
r[i].x=(short)x1;
r[i].y=(short)y1;
r[i].width=(unsigned short)(x2-r[i].x);
r[i].height=(unsigned short)(y2-r[i].y);
++i;
r[*i].x=(short)x1;
r[*i].y=(short)y1;
r[*i].width=(unsigned short)(x2-r[*i].x);
r[*i].height=(unsigned short)(y2-r[*i].y);
++(*i);
}
}
else if((what & END) && i)
else if(what & END)
{
if(xctx->draw_window) XFillRectangles(display, xctx->window, xctx->gcstipple[c], r,i);
if(xctx->draw_pixmap) XFillRectangles(display, xctx->save_pixmap, xctx->gcstipple[c], r,i);
i=0;
if(iis) {
if(xctx->draw_window) XFillRectangles(display, xctx->window, xctx->gcstipple[c], rs, iis);
if(xctx->draw_pixmap) XFillRectangles(display, xctx->save_pixmap, xctx->gcstipple[c], rs ,iis);
iis = 0;
}
if(iif) {
if(xctx->draw_window) XFillRectangles(display, xctx->window, xctx->gc[c], rf ,iif);
if(xctx->draw_pixmap) XFillRectangles(display, xctx->save_pixmap, xctx->gc[c], rf ,iif);
iif = 0;
}
}
}
@ -1661,6 +1687,7 @@ void arc_bbox(double x, double y, double r, double a, double b,
/* Convex Nonconvex Complex */
#define Polygontype Nonconvex
/* fill = 1: stippled fill, fill == 3: solid fill */
void drawbezier(Drawable w, GC gc, int c, double *x, double *y, int points, int fill)
{
const double bez_steps = 1.0/32.0; /* divide the t = [0,1] interval into 32 steps */
@ -1722,9 +1749,10 @@ void drawbezier(Drawable w, GC gc, int c, double *x, double *y, int points, int
}
}
XDrawLines(display, w, gc, p, i, CoordModeOrigin);
if(fill) {
if(fill == 1)
XFillPolygon(display, w, xctx->gcstipple[c], p, i, Polygontype, CoordModeOrigin);
}
else if(fill==3)
XFillPolygon(display, w, xctx->gc[c], p, i, Polygontype, CoordModeOrigin);
}
/* Unused 'what' parameter used in spice data draw_graph()
@ -1736,8 +1764,8 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
XPoint *p;
int i;
short sx, sy;
GC gc;
if(!has_x) return;
polygon_bbox(x, y, points, &x1,&y1,&x2,&y2);
x1=X_TO_SCREEN(x1);
x2=X_TO_SCREEN(x2);
@ -1759,8 +1787,8 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
for(i=0;i<points; ++i) p[i].x = (short)X_TO_SCREEN(x[i]);
for(i=0;i<points; ++i) p[i].y = (short)Y_TO_SCREEN(y[i]);
}
fill = xctx->fill_pattern && xctx->fill_type[c] &&
poly_fill && (x[0] == x[points-1]) && (y[0] == y[points-1]);
fill = xctx->fill_pattern && ((xctx->fill_type[c] && poly_fill == 1) || poly_fill == 3 ) &&
(x[0] == x[points-1]) && (y[0] == y[points-1]);
bezier = (flags & 1) && (points > 2);
if(dash) {
char dash_arr[2];
@ -1770,23 +1798,25 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
}
if(xctx->draw_window) {
if(bezier) {
drawbezier(xctx->window, xctx->gc[c], c, x, y, points, fill);
drawbezier(xctx->window, xctx->gc[c], c, x, y, points, fill | (poly_fill & 2) );
} else {
XDrawLines(display, xctx->window, xctx->gc[c], p, points, CoordModeOrigin);
}
}
if(xctx->draw_pixmap) {
if(bezier) {
drawbezier(xctx->save_pixmap, xctx->gc[c], c, x, y, points, fill);
drawbezier(xctx->save_pixmap, xctx->gc[c], c, x, y, points, fill | (poly_fill & 2) );
} else {
XDrawLines(display, xctx->save_pixmap, xctx->gc[c], p, points, CoordModeOrigin);
}
}
if(poly_fill & 2) gc = xctx->gc[c];
else gc = xctx->gcstipple[c];
if(fill && !bezier) {
if(xctx->draw_window)
XFillPolygon(display, xctx->window, xctx->gcstipple[c], p, points, Polygontype, CoordModeOrigin);
XFillPolygon(display, xctx->window, gc, p, points, Polygontype, CoordModeOrigin);
if(xctx->draw_pixmap)
XFillPolygon(display, xctx->save_pixmap, xctx->gcstipple[c], p, points, Polygontype, CoordModeOrigin);
XFillPolygon(display, xctx->save_pixmap, gc, p, points, Polygontype, CoordModeOrigin);
}
if(dash) {
XSetLineAttributes (display, xctx->gc[c], XLINEWIDTH(xctx->lw) ,LineSolid, LINECAP , LINEJOIN);
@ -2604,7 +2634,7 @@ static void draw_graph_grid(Graph_ctx *gr, void *ct)
/* clipping everything outside container area */
/* background */
filledrect(0, NOW, gr->rx1, gr->ry1, gr->rx2, gr->ry2);
filledrect(0, NOW, gr->rx1, gr->ry1, gr->rx2, gr->ry2, 3);
/* graph bounding box */
drawrect(GRIDLAYER, NOW, gr->rx1, gr->ry1, gr->rx2, gr->ry2, 2);
@ -2876,7 +2906,7 @@ static void draw_cursor(double active_cursorx, double other_cursorx, int cursor_
else
my_snprintf(tmpstr, S(tmpstr), "%s", dtoa_eng(active_cursorx));
text_bbox(tmpstr, txtsize, txtsize, 2, flip, 0, 0, xx + xoffs, gr->ry2-1, &tx1, &ty1, &tx2, &ty2, &tmp, &dtmp);
filledrect(0, NOW, tx1, ty1, tx2, ty2);
filledrect(0, NOW, tx1, ty1, tx2, ty2, 3);
draw_string(cursor_color, NOW, tmpstr, 2, flip, 0, 0, xx + xoffs, gr->ry2-1, txtsize, txtsize);
}
}
@ -4205,7 +4235,7 @@ void draw(void)
#endif
{
drawrect(cc, ADD, r->x1, r->y1, r->x2, r->y2, r->dash);
if(r->fill) filledrect(cc, ADD, r->x1, r->y1, r->x2, r->y2);
if(r->fill) filledrect(cc, ADD, r->x1, r->y1, r->x2, r->y2, r->fill);
}
}
if(xctx->enable_layer[c]) for(i=0;i<xctx->arcs[c]; ++i) {
@ -4243,7 +4273,7 @@ void draw(void)
draw_symbol(ADD, cc, i,c,0,0,0.0,0.0); /* ... then draw current layer */
}
}
filledrect(cc, END, 0.0, 0.0, 0.0, 0.0);
filledrect(cc, END, 0.0, 0.0, 0.0, 0.0, 3); /* last parameter must be 3! */
drawarc(cc, END, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0);
drawrect(cc, END, 0.0, 0.0, 0.0, 0.0, 0);
drawline(cc, END, 0.0, 0.0, 0.0, 0.0, 0, NULL);
@ -4270,7 +4300,7 @@ void draw(void)
xctx->wire[i].x2,xctx->wire[i].y2, 0, NULL);
}
update_conn_cues(cc, 1, xctx->draw_window);
filledrect(cc, END, 0.0, 0.0, 0.0, 0.0);
filledrect(cc, END, 0.0, 0.0, 0.0, 0.0, 3); /* last parameter must be 3! */
drawline(cc, END, 0.0, 0.0, 0.0, 0.0, 0, NULL);
}
if(xctx->draw_single_layer ==-1 || xctx->draw_single_layer==TEXTLAYER) {

View File

@ -901,6 +901,7 @@ static int edit_rect_property(int x)
if(strcmp(tclgetvar("tctx::rcode"),"") )
{
xctx->push_undo();
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
for(i=0; i<xctx->lastsel; ++i) {
if(xctx->sel_array[i].type != xRECT) continue;
c = xctx->sel_array[i].col;
@ -922,22 +923,26 @@ static int edit_rect_property(int x)
xctx->rect[c][n].dash = 0;
fill = get_tok_value(xctx->rect[c][n].prop_ptr,"fill", 0);
if(!strboolcmp(fill, "false")) xctx->rect[c][n].fill = 0;
if(!strcmp(fill, "full")) xctx->rect[c][n].fill = 3;
else if(!strboolcmp(fill, "false")) xctx->rect[c][n].fill = 0;
else xctx->rect[c][n].fill = 1;
if( (oldprop && xctx->rect[c][n].prop_ptr && strcmp(oldprop, xctx->rect[c][n].prop_ptr)) ||
(!oldprop && xctx->rect[c][n].prop_ptr) || (oldprop && !xctx->rect[c][n].prop_ptr)) {
if(!drw) {
drw = 1;
}
modified = 1;
drw = 1;
if( xctx->rect[c][n].flags & 1024) {
draw_image(0, &xctx->rect[c][n], &xctx->rect[c][n].x1, &xctx->rect[c][n].y1,
&xctx->rect[c][n].x2, &xctx->rect[c][n].y2, 0, 0);
}
bbox(ADD, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2);
}
}
if(drw) draw();
modified = 1;
if(drw) {
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
draw();
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
}
}
my_free(_ALLOC_ID_, &oldprop);
return modified;
@ -1067,7 +1072,7 @@ static int edit_arc_property(void)
double x1, y1, x2, y2;
int c, i, ii, old_dash, drw = 0;
char *oldprop = NULL;
const char *dash;
const char *dash, *fill_ptr;
int preserve, modified = 0;
my_strdup(_ALLOC_ID_, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
@ -1096,7 +1101,10 @@ static int edit_arc_property(void)
my_strdup(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"));
}
old_fill = xctx->arc[c][i].fill;
if( !strboolcmp(get_tok_value(xctx->arc[c][i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(xctx->arc[c][i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr,"full") )
xctx->arc[c][i].fill =3; /* bit 1: solid fill (not stippled) */
else if( !strboolcmp(fill_ptr,"true") )
xctx->arc[c][i].fill =1;
else
xctx->arc[c][i].fill =0;
@ -1130,6 +1138,7 @@ static int edit_arc_property(void)
static int edit_polygon_property(void)
{
const char *fill_ptr;
int old_fill;
int oldbezier, bezier;
int k;
@ -1169,7 +1178,11 @@ static int edit_polygon_property(void)
old_fill = xctx->poly[c][i].fill;
old_dash = xctx->poly[c][i].dash;
bezier = !strboolcmp(get_tok_value(xctx->poly[c][i].prop_ptr,"bezier",0),"true") ;
if( !strboolcmp(get_tok_value(xctx->poly[c][i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(xctx->poly[c][i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr,"full") )
xctx->poly[c][i].fill =3; /* bit 1: solid fill (not stippled) */
else if( !strboolcmp(fill_ptr,"true") )
xctx->poly[c][i].fill =1;
else
xctx->poly[c][i].fill =0;

View File

@ -2079,7 +2079,7 @@ void draw_hilight_net(int on_window)
((c==TEXTWIRELAYER || c==TEXTLAYER) && symptr->texts)) {
draw_symbol(ADD, col, i,c,0,0,0.0,0.0);
}
filledrect(col, END, 0.0, 0.0, 0.0, 0.0);
filledrect(col, END, 0.0, 0.0, 0.0, 0.0, 3); /* last parameter must be 3! */
drawarc(col, END, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0);
drawrect(col, END, 0.0, 0.0, 0.0, 0.0, 0);
drawline(col, END, 0.0, 0.0, 0.0, 0.0, 0, NULL);

View File

@ -73,7 +73,7 @@ static void merge_box(FILE *fd)
{
int i,c,n;
xRect *ptr;
const char *dash;
const char *dash, *fill_ptr;
n = fscanf(fd, "%d",&c);
if(n != 1 || c < 0 || c >= cadlayers) {
@ -102,7 +102,10 @@ static void merge_box(FILE *fd)
} else {
ptr[i].dash = 0;
}
if( !strboolcmp(get_tok_value(ptr[i].prop_ptr,"fill",0),"false") )
fill_ptr = get_tok_value(ptr[i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
ptr[i].fill =3;
else if( !strboolcmp(fill_ptr, "false") )
ptr[i].fill =0;
else
ptr[i].fill =1;
@ -115,7 +118,7 @@ static void merge_arc(FILE *fd)
{
int i,c,n;
xArc *ptr;
const char *dash;
const char *dash, *fill_ptr;
n = fscanf(fd, "%d",&c);
if(n != 1 || c < 0 || c >= cadlayers) {
@ -136,7 +139,12 @@ static void merge_arc(FILE *fd)
ptr[i].prop_ptr=NULL;
ptr[i].sel=0;
load_ascii_string(&ptr[i].prop_ptr, fd);
if( !strboolcmp(get_tok_value(ptr[i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(ptr[i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
ptr[i].fill =3; /* bit 1: solid fill (not stippled) */
else if( !strboolcmp(fill_ptr, "true") )
ptr[i].fill =1;
else
ptr[i].fill =0;
@ -155,6 +163,7 @@ static void merge_arc(FILE *fd)
static void merge_polygon(FILE *fd)
{
const char *fill_ptr;
int i,c, j, points;
xPoly *ptr;
const char *dash;
@ -192,7 +201,10 @@ static void merge_polygon(FILE *fd)
}
}
load_ascii_string( &ptr[i].prop_ptr, fd);
if( !strboolcmp(get_tok_value(ptr[i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(ptr[i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
ptr[i].fill =3; /* bit 1: solid fill (not stippled) */
else if( !strboolcmp(fill_ptr, "true") )
ptr[i].fill =1;
else
ptr[i].fill =0;

View File

@ -2527,6 +2527,7 @@ static void load_inst(int k, FILE *fd)
static void load_polygon(FILE *fd)
{
const char *fill_ptr;
int i,c, j, points;
xPoly *ptr;
const char *dash;
@ -2565,7 +2566,10 @@ static void load_polygon(FILE *fd)
}
}
load_ascii_string( &ptr[i].prop_ptr, fd);
if( !strboolcmp(get_tok_value(ptr[i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(ptr[i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
ptr[i].fill =3; /* bit 1: solid fill (not stippled) */
else if( !strboolcmp(fill_ptr, "true") )
ptr[i].fill =1;
else
ptr[i].fill =0;
@ -2584,7 +2588,7 @@ static void load_arc(FILE *fd)
{
int n,i,c;
xArc *ptr;
const char *dash;
const char *dash, *fill_ptr;
dbg(3, "load_arc(): start\n");
n = fscanf(fd, "%d",&c);
@ -2605,7 +2609,11 @@ static void load_arc(FILE *fd)
ptr[i].prop_ptr=NULL;
ptr[i].sel=0;
load_ascii_string(&ptr[i].prop_ptr, fd);
if( !strboolcmp(get_tok_value(ptr[i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(ptr[i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
ptr[i].fill =3; /* bit 1: solid fill (not stippled) */
else if( !strboolcmp(fill_ptr, "true") )
ptr[i].fill =1;
else
ptr[i].fill =0;
@ -2623,7 +2631,7 @@ static void load_box(FILE *fd)
{
int i,n,c;
xRect *ptr;
const char *dash;
const char *dash, *fill_ptr;
dbg(3, "load_box(): start\n");
n = fscanf(fd, "%d",&c);
@ -2646,7 +2654,10 @@ static void load_box(FILE *fd)
ptr[i].prop_ptr=NULL;
ptr[i].sel=0;
load_ascii_string( &ptr[i].prop_ptr, fd);
if( !strboolcmp(get_tok_value(ptr[i].prop_ptr,"fill",0),"false") )
fill_ptr = get_tok_value(ptr[i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
ptr[i].fill =3;
else if( !strboolcmp(fill_ptr, "false") )
ptr[i].fill =0;
else
ptr[i].fill =1;
@ -3801,7 +3812,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
xText tmptext, *tt;
int endfile;
char *skip_line;
const char *dash;
const char *dash, *fill_ptr;
xSymbol * symbol;
int symbols, sym_n_pins=0, generator;
char *cmd = NULL;
@ -4056,7 +4067,10 @@ int load_sym_def(const char *name, FILE *embed_fd)
pp[c][i].prop_ptr = tmppoly.prop_ptr;
pp[c][i].points = poly_points;
if( !strboolcmp(get_tok_value(pp[c][i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(pp[c][i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
pp[c][i].fill =3; /* bit 1: solid fill (not stippled) */
else if( !strboolcmp(fill_ptr, "true") )
pp[c][i].fill =1;
else
pp[c][i].fill =0;
@ -4118,7 +4132,10 @@ int load_sym_def(const char *name, FILE *embed_fd)
aa[c][i].x = lcc[level].x0 + rx1; aa[c][i].y = lcc[level].y0 + ry1;
aa[c][i].a = angle;
}
if( !strboolcmp(get_tok_value(aa[c][i].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(aa[c][i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
aa[c][i].fill =3; /* bit 1: solid fill (not stiaaled) */
else if( !strboolcmp(fill_ptr, "true") )
aa[c][i].fill =1;
else
aa[c][i].fill =0;
@ -4178,7 +4195,10 @@ int load_sym_def(const char *name, FILE *embed_fd)
continue;
}
dbg(2, "l_s_d(): loaded rect: ptr=%lx\n", (unsigned long)bb[c]);
if( !strboolcmp(get_tok_value(bb[c][i].prop_ptr,"fill",0),"false") )
fill_ptr = get_tok_value(bb[c][i].prop_ptr,"fill",0);
if( !strcmp(fill_ptr, "full") )
bb[c][i].fill =3;
else if( !strboolcmp(fill_ptr, "false") )
bb[c][i].fill =0;
else
bb[c][i].fill =1;

View File

@ -437,7 +437,7 @@ static void del_rect_line_arc_poly()
{
++j;
if(xctx->arc[c][i].fill)
if(xctx->arc[c][i].fill & 1) /* .fill: 1: stippled fill, 3: solid fill */
arc_bbox(xctx->arc[c][i].x, xctx->arc[c][i].y, xctx->arc[c][i].r, 0, 360,
&tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
else

View File

@ -133,7 +133,7 @@ void store_arc(int pos, double x, double y, double r, double a, double b,
unsigned int rectc, unsigned short sel, char *prop_ptr)
{
int n, j;
const char *dash;
const char *dash, *fill_ptr;
check_arc_storage(rectc);
if(pos==-1) n=xctx->arcs[rectc];
else
@ -153,7 +153,11 @@ void store_arc(int pos, double x, double y, double r, double a, double b,
my_strdup(_ALLOC_ID_, &xctx->arc[rectc][n].prop_ptr, prop_ptr);
xctx->arc[rectc][n].sel = sel;
if(sel == SELECTED) set_first_sel(ARC, n, rectc);
if( !strboolcmp(get_tok_value(xctx->arc[rectc][n].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(xctx->arc[rectc][n].prop_ptr,"fill",0);
if(!strcmp(fill_ptr, "full") )
xctx->arc[rectc][n].fill =3; /* bit 1: solid fill (not stippled) */
else if(!strboolcmp(fill_ptr, "true") )
xctx->arc[rectc][n].fill =1;
else
xctx->arc[rectc][n].fill =0;
@ -171,7 +175,7 @@ void store_poly(int pos, double *x, double *y, int points, unsigned int rectc,
unsigned short sel, char *prop_ptr)
{
int n, j;
const char *dash;
const char *dash, *fill_ptr;
check_polygon_storage(rectc);
if(pos==-1) n=xctx->polygons[rectc];
else
@ -200,7 +204,10 @@ void store_poly(int pos, double *x, double *y, int points, unsigned int rectc,
xctx->poly[rectc][n].sel = sel;
if(sel == SELECTED) set_first_sel(POLYGON, n, rectc);
if( !strboolcmp(get_tok_value(xctx->poly[rectc][n].prop_ptr,"fill",0),"true") )
fill_ptr = get_tok_value(xctx->poly[rectc][n].prop_ptr,"fill",0);
if(!strcmp(fill_ptr, "full") )
xctx->poly[rectc][n].fill =3; /* bit 1: solid fill (not stippled) */
else if(!strboolcmp(fill_ptr, "true") )
xctx->poly[rectc][n].fill =1;
else
xctx->poly[rectc][n].fill =0;
@ -220,7 +227,7 @@ int storeobject(int pos, double x1,double y1,double x2,double y2,
unsigned short sel, const char *prop_ptr)
{
int n, j, modified = 0;
const char *dash;
const char *dash, *fill_ptr;
if(type == LINE)
{
check_line_storage(rectc);
@ -282,7 +289,10 @@ int storeobject(int pos, double x1,double y1,double x2,double y2,
xctx->rect[rectc][n].dash = (char) (d >= 0 ? d : 0);
} else
xctx->rect[rectc][n].dash = 0;
if(!strboolcmp(get_tok_value(xctx->rect[rectc][n].prop_ptr,"fill",0),"false") )
fill_ptr = get_tok_value(xctx->rect[rectc][n].prop_ptr, "fill", 0);
if(!strcmp(fill_ptr, "full") )
xctx->rect[rectc][n].fill =3;
else if(!strboolcmp(fill_ptr,"false") )
xctx->rect[rectc][n].fill =0;
else
xctx->rect[rectc][n].fill =1;

View File

@ -1383,7 +1383,7 @@ extern void draw_symbol(int what,int c, int n,int layer,
extern void drawrect(int c, int what, double rectx1,double recty1,
double rectx2,double recty2, int dash);
extern void filledrect(int c, int what, double rectx1,double recty1,
double rectx2,double recty2);
double rectx2,double recty2, int fill);
extern void drawtempline(GC gc, int what, double x1,double y1,double x2,double y2);

View File

@ -194,7 +194,7 @@ proc netlist_test {} {
greycnt.sch verilog 2899796185
autozero_comp.sch spice 751826850
test_generators.sch spice 49312823
inst_sch_select.sch spice 2240134366
inst_sch_select.sch spice 3684652626
test_bus_tap.sch spice 188702715
loading.sch vhdl 2975204502
mos_power_ampli.sch spice 125840804