revert pro floaters. black hole, wrong approach
This commit is contained in:
parent
2a205d298a
commit
c1a92ab5dc
|
|
@ -1412,7 +1412,6 @@ void calc_drawing_bbox(xRect *boundbox, int selected)
|
|||
{
|
||||
xRect rect;
|
||||
int c, i;
|
||||
const char *txtptr;
|
||||
int count=0;
|
||||
#if HAS_CAIRO==1
|
||||
int customfont;
|
||||
|
|
@ -1513,18 +1512,10 @@ void calc_drawing_bbox(xRect *boundbox, int selected)
|
|||
{
|
||||
int no_of_lines, longest_line;
|
||||
if(selected == 1 && !xctx->text[i].sel) continue;
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
|
||||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[i]);
|
||||
#endif
|
||||
if(text_bbox(txtptr, xctx->text[i].xscale,
|
||||
if(text_bbox(xctx->text[i].txt_ptr, xctx->text[i].xscale,
|
||||
xctx->text[i].yscale,xctx->text[i].rot, xctx->text[i].flip,
|
||||
xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0, xctx->text[i].y0,
|
||||
|
|
@ -2567,9 +2558,7 @@ int place_text(int draw_text, double mx, double my)
|
|||
str = get_tok_value(t->prop_ptr, "weight", 0);
|
||||
t->flags |= strcmp(str, "bold") ? 0 : TEXT_BOLD;
|
||||
str = get_tok_value(t->prop_ptr, "hide", 0);
|
||||
t->flags |= strcmp(str, "true") ? 0 : TEXT_HIDE;
|
||||
str = get_tok_value(t->prop_ptr, "inst", 0);
|
||||
t->flags |= str[0] ? TEXT_TRANSLATE : 0;
|
||||
t->flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
|
||||
my_strdup(21, &t->font, get_tok_value(t->prop_ptr, "font", 0));
|
||||
textlayer = t->layer;
|
||||
|
|
|
|||
16
src/draw.c
16
src/draw.c
|
|
@ -515,7 +515,7 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot,
|
|||
{
|
||||
text = symptr->text[j];
|
||||
if(text.xscale*FONTWIDTH*xctx->mooz<1) continue;
|
||||
if(symptr->text[j].flags & TEXT_HIDE) continue;
|
||||
if(symptr->text[j].flags & HIDE_TEXT) continue;
|
||||
if( hide && text.txt_ptr && strcmp(text.txt_ptr, "@symname") && strcmp(text.txt_ptr, "@name") ) continue;
|
||||
txtptr= translate(n, text.txt_ptr);
|
||||
ROTATION(rot, flip, 0.0,0.0,text.x0,text.y0,x1,y1);
|
||||
|
|
@ -3032,20 +3032,12 @@ void draw(void)
|
|||
drawline(WIRELAYER, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
}
|
||||
if(xctx->draw_single_layer ==-1 || xctx->draw_single_layer==TEXTLAYER) {
|
||||
const char *txtptr;
|
||||
for(i=0;i<xctx->texts;i++)
|
||||
{
|
||||
textlayer = xctx->text[i].layer;
|
||||
if(xctx->text[i].flags & TEXT_HIDE) continue;
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
if(xctx->text[i].flags & HIDE_TEXT) continue;
|
||||
if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER;
|
||||
dbg(1, "draw(): drawing string %d = %s\n",i, txtptr);
|
||||
dbg(1, "draw(): drawing string %d = %s\n",i, xctx->text[i].txt_ptr);
|
||||
#if HAS_CAIRO==1
|
||||
if(!xctx->enable_layer[textlayer]) continue;
|
||||
textfont = xctx->text[i].font;
|
||||
|
|
@ -3066,7 +3058,7 @@ void draw(void)
|
|||
cairo_select_font_face (xctx->cairo_save_ctx, textfont, slant, weight);
|
||||
}
|
||||
#endif
|
||||
draw_string(textlayer, ADD, txtptr,
|
||||
draw_string(textlayer, ADD, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0,xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ static void edit_text_property(int x)
|
|||
double xx1,yy1,xx2,yy2;
|
||||
double pcx,pcy; /* pin center 20070317 */
|
||||
char property[1024];/* used for float 2 string conv (xscale and yscale) overflow safe */
|
||||
const char *str, *txtptr;
|
||||
const char *str;
|
||||
char *oldprop = NULL;
|
||||
|
||||
dbg(1, "edit_text_property(): entering\n");
|
||||
|
|
@ -884,20 +884,16 @@ static void edit_text_property(int x)
|
|||
sel=xctx->sel_array[k].n;
|
||||
rot = xctx->text[sel].rot; /* calculate bbox, some cleanup needed here */
|
||||
flip = xctx->text[sel].flip;
|
||||
if(xctx->text[sel].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[sel].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[sel].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[sel].txt_ptr;
|
||||
}
|
||||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[sel]);
|
||||
#endif
|
||||
text_bbox(txtptr, xctx->text[sel].xscale,
|
||||
text_bbox(xctx->text[sel].txt_ptr, xctx->text[sel].xscale,
|
||||
xctx->text[sel].yscale, rot, flip, xctx->text[sel].hcenter,
|
||||
xctx->text[sel].vcenter, xctx->text[sel].x0, xctx->text[sel].y0,
|
||||
&xx1,&yy1,&xx2,&yy2, &tmp, &tmp);
|
||||
#if HAS_CAIRO==1
|
||||
if(customfont) cairo_restore(xctx->cairo_ctx);
|
||||
#endif
|
||||
bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
dbg(1, "edit_property(): text props: props=%s text=%s\n",
|
||||
tclgetvar("props"),
|
||||
|
|
@ -909,6 +905,16 @@ static void edit_text_property(int x)
|
|||
for(l=0;l<c;l++) {
|
||||
if(!strcmp( (get_tok_value(xctx->rect[PINLAYER][l].prop_ptr, "name",0)),
|
||||
xctx->text[sel].txt_ptr) ) {
|
||||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[sel]);
|
||||
#endif
|
||||
text_bbox(xctx->text[sel].txt_ptr, xctx->text[sel].xscale,
|
||||
xctx->text[sel].yscale, rot, flip, xctx->text[sel].hcenter,
|
||||
xctx->text[sel].vcenter, xctx->text[sel].x0, xctx->text[sel].y0,
|
||||
&xx1,&yy1,&xx2,&yy2, &tmp, &tmp);
|
||||
#if HAS_CAIRO==1
|
||||
if(customfont) cairo_restore(xctx->cairo_ctx);
|
||||
#endif
|
||||
pcx = (xctx->rect[PINLAYER][l].x1+xctx->rect[PINLAYER][l].x2)/2.0;
|
||||
pcy = (xctx->rect[PINLAYER][l].y1+xctx->rect[PINLAYER][l].y2)/2.0;
|
||||
if(
|
||||
|
|
@ -932,9 +938,6 @@ static void edit_text_property(int x)
|
|||
}
|
||||
my_strdup(74, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval"));
|
||||
}
|
||||
#if HAS_CAIRO==1
|
||||
if(customfont) cairo_restore(xctx->cairo_ctx);
|
||||
#endif
|
||||
if(x==0) {
|
||||
if(oldprop && preserve)
|
||||
set_different_token(&xctx->text[sel].prop_ptr, (char *) tclgetvar("props"), oldprop, 0, 0);
|
||||
|
|
@ -955,10 +958,7 @@ static void edit_text_property(int x)
|
|||
str = get_tok_value(xctx->text[sel].prop_ptr, "weight", 0);
|
||||
xctx->text[sel].flags |= strcmp(str, "bold") ? 0 : TEXT_BOLD;
|
||||
str = get_tok_value(xctx->text[sel].prop_ptr, "hide", 0);
|
||||
xctx->text[sel].flags |= strcmp(str, "true") ? 0 : TEXT_HIDE;
|
||||
str = get_tok_value(xctx->text[sel].prop_ptr, "inst", 0);
|
||||
xctx->text[sel].flags |= str[0] ? TEXT_TRANSLATE : 0;
|
||||
|
||||
xctx->text[sel].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
if(k == 0 ) {
|
||||
hsize =atof(tclgetvar("hsize"));
|
||||
vsize =atof(tclgetvar("vsize"));
|
||||
|
|
@ -975,14 +975,7 @@ static void edit_text_property(int x)
|
|||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[sel]);
|
||||
#endif
|
||||
if(xctx->text[sel].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[sel].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[sel].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[sel].txt_ptr;
|
||||
}
|
||||
text_bbox(txtptr, xctx->text[sel].xscale,
|
||||
text_bbox(xctx->text[sel].txt_ptr, xctx->text[sel].xscale,
|
||||
xctx->text[sel].yscale, rot, flip, xctx->text[sel].hcenter,
|
||||
xctx->text[sel].vcenter, xctx->text[sel].x0, xctx->text[sel].y0,
|
||||
&xx1,&yy1,&xx2,&yy2, &tmp, &tmp);
|
||||
|
|
|
|||
|
|
@ -283,7 +283,6 @@ static void find_closest_text(double mx,double my)
|
|||
#if HAS_CAIRO==1
|
||||
int customfont;
|
||||
#endif
|
||||
const char *txtptr;
|
||||
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom;
|
||||
for(i=0;i<xctx->texts;i++)
|
||||
{
|
||||
|
|
@ -292,14 +291,7 @@ static void find_closest_text(double mx,double my)
|
|||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[i]);
|
||||
#endif
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
text_bbox(txtptr,
|
||||
text_bbox(xctx->text[i].txt_ptr,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale, rot, flip,
|
||||
xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0, xctx->text[i].y0,
|
||||
|
|
|
|||
42
src/move.c
42
src/move.c
|
|
@ -192,7 +192,6 @@ void draw_selection(GC g, int interruptable)
|
|||
#if HAS_CAIRO==1
|
||||
int customfont;
|
||||
#endif
|
||||
const char *txtptr;
|
||||
|
||||
if(g == xctx->gc[SELLAYER]) xctx->movelastsel = xctx->lastsel;
|
||||
for(i=0;i<xctx->movelastsel;i++)
|
||||
|
|
@ -211,15 +210,7 @@ void draw_selection(GC g, int interruptable)
|
|||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[n]);
|
||||
#endif
|
||||
if(xctx->text[n].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[n].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[n].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[n].txt_ptr;
|
||||
}
|
||||
|
||||
draw_temp_string(g,ADD, txtptr,
|
||||
draw_temp_string(g,ADD, xctx->text[n].txt_ptr,
|
||||
(xctx->text[n].rot +
|
||||
( (xctx->move_flip && (xctx->text[n].rot & 1) ) ? xctx->move_rot+2 : xctx->move_rot) ) & 0x3,
|
||||
xctx->text[n].flip^xctx->move_flip, xctx->text[n].hcenter, xctx->text[n].vcenter,
|
||||
|
|
@ -616,7 +607,7 @@ void copy_objects(int what)
|
|||
#if HAS_CAIRO==1
|
||||
int customfont;
|
||||
#endif
|
||||
const char *txtptr;
|
||||
|
||||
if(what & START)
|
||||
{
|
||||
xctx->rotatelocal=0;
|
||||
|
|
@ -928,10 +919,7 @@ void copy_objects(int what)
|
|||
str = get_tok_value(xctx->text[xctx->texts].prop_ptr, "weight", 0);
|
||||
xctx->text[xctx->texts].flags |= strcmp(str, "bold") ? 0 : TEXT_BOLD;
|
||||
str = get_tok_value(xctx->text[xctx->texts].prop_ptr, "hide", 0);
|
||||
xctx->text[xctx->texts].flags |= strcmp(str, "true") ? 0 : TEXT_HIDE;
|
||||
str = get_tok_value(xctx->text[xctx->texts].prop_ptr, "inst", 0);
|
||||
xctx->text[xctx->texts].flags |= str[0] ? TEXT_TRANSLATE : 0;
|
||||
|
||||
xctx->text[xctx->texts].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
|
||||
xctx->text[xctx->texts].xscale=xctx->text[n].xscale;
|
||||
xctx->text[xctx->texts].yscale=xctx->text[n].yscale;
|
||||
|
|
@ -941,14 +929,7 @@ void copy_objects(int what)
|
|||
#if HAS_CAIRO==1 /* bbox after copy */
|
||||
customfont = set_text_custom_font(&xctx->text[l]);
|
||||
#endif
|
||||
if(xctx->text[l].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[l].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[l].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[l].txt_ptr;
|
||||
}
|
||||
text_bbox(txtptr, xctx->text[l].xscale,
|
||||
text_bbox(xctx->text[l].txt_ptr, xctx->text[l].xscale,
|
||||
xctx->text[l].yscale, xctx->text[l].rot,xctx->text[l].flip,
|
||||
xctx->text[l].hcenter, xctx->text[l].vcenter,
|
||||
xctx->text[l].x0, xctx->text[l].y0,
|
||||
|
|
@ -970,6 +951,9 @@ void copy_objects(int what)
|
|||
|
||||
} /* end for(k=0;k<cadlayers;k++) */
|
||||
|
||||
|
||||
|
||||
|
||||
for(i = 0; i < xctx->lastsel; i++) {
|
||||
n = xctx->sel_array[i].n;
|
||||
if(xctx->sel_array[i].type == ELEMENT) {
|
||||
|
|
@ -1051,7 +1035,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
#endif
|
||||
xLine ** const line = xctx->line;
|
||||
xWire * const wire = xctx->wire;
|
||||
const char *txtptr;
|
||||
|
||||
if(what & START)
|
||||
{
|
||||
|
|
@ -1459,14 +1442,7 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
#if HAS_CAIRO==1 /* bbox before move */
|
||||
customfont = set_text_custom_font(&xctx->text[n]);
|
||||
#endif
|
||||
if(xctx->text[n].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[n].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[n].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[n].txt_ptr;
|
||||
}
|
||||
text_bbox(txtptr, xctx->text[n].xscale,
|
||||
text_bbox(xctx->text[n].txt_ptr, xctx->text[n].xscale,
|
||||
xctx->text[n].yscale, xctx->text[n].rot,xctx->text[n].flip, xctx->text[n].hcenter,
|
||||
xctx->text[n].vcenter, xctx->text[n].x0, xctx->text[n].y0,
|
||||
&xctx->rx1,&xctx->ry1, &xctx->rx2,&xctx->ry2, &tmpint, &tmpint);
|
||||
|
|
@ -1490,7 +1466,7 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
#if HAS_CAIRO==1 /* bbox after move */
|
||||
customfont = set_text_custom_font(&xctx->text[n]);
|
||||
#endif
|
||||
text_bbox(txtptr, xctx->text[n].xscale,
|
||||
text_bbox(xctx->text[n].txt_ptr, xctx->text[n].xscale,
|
||||
xctx->text[n].yscale, xctx->text[n].rot,xctx->text[n].flip, xctx->text[n].hcenter,
|
||||
xctx->text[n].vcenter, xctx->text[n].x0, xctx->text[n].y0,
|
||||
&xctx->rx1,&xctx->ry1, &xctx->rx2,&xctx->ry2, &tmpint, &tmpint);
|
||||
|
|
|
|||
|
|
@ -65,10 +65,7 @@ static void merge_text(FILE *fd)
|
|||
str = get_tok_value(xctx->text[i].prop_ptr, "weight", 0);
|
||||
xctx->text[i].flags |= strcmp(str, "bold") ? 0 : TEXT_BOLD;
|
||||
str = get_tok_value(xctx->text[i].prop_ptr, "hide", 0);
|
||||
xctx->text[i].flags |= strcmp(str, "true") ? 0 : TEXT_HIDE;
|
||||
str = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
xctx->text[i].flags |= str[0] ? TEXT_TRANSLATE : 0;
|
||||
|
||||
xctx->text[i].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
|
||||
select_text(i,SELECTED, 1);
|
||||
set_modify(1);
|
||||
|
|
|
|||
|
|
@ -684,7 +684,7 @@ void create_ps(char **psfile, int what)
|
|||
xRect boundbox;
|
||||
int c,i, textlayer;
|
||||
int old_grid;
|
||||
const char *textfont, *txtptr;
|
||||
const char *textfont;
|
||||
|
||||
if(what & 1) { /* prolog */
|
||||
numpages = 0;
|
||||
|
|
@ -831,20 +831,13 @@ void create_ps(char **psfile, int what)
|
|||
else if( xctx->text[i].flags & TEXT_OBLIQUE)
|
||||
my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name);
|
||||
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
if(text_ps) {
|
||||
ps_draw_string(textlayer, txtptr,
|
||||
ps_draw_string(textlayer, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0,xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
} else {
|
||||
old_ps_draw_string(textlayer, txtptr,
|
||||
old_ps_draw_string(textlayer, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0,xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
|
|
|
|||
10
src/save.c
10
src/save.c
|
|
@ -1289,10 +1289,7 @@ static void load_text(FILE *fd)
|
|||
str = get_tok_value(xctx->text[i].prop_ptr, "weight", 0);
|
||||
xctx->text[i].flags |= strcmp(str, "bold") ? 0 : TEXT_BOLD;
|
||||
str = get_tok_value(xctx->text[i].prop_ptr, "hide", 0);
|
||||
xctx->text[i].flags |= strcmp(str, "true") ? 0 : TEXT_HIDE;
|
||||
str = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
xctx->text[i].flags |= str[0] ? TEXT_TRANSLATE : 0;
|
||||
|
||||
xctx->text[i].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
|
||||
xctx->texts++;
|
||||
}
|
||||
|
|
@ -2810,10 +2807,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
str = get_tok_value(tt[i].prop_ptr, "weight", 0);
|
||||
tt[i].flags |= strcmp(str, "bold") ? 0 : TEXT_BOLD;
|
||||
str = get_tok_value(tt[i].prop_ptr, "hide", 0);
|
||||
tt[i].flags |= strcmp(str, "true") ? 0 : TEXT_HIDE;
|
||||
str = get_tok_value(tt[i].prop_ptr, "inst", 0);
|
||||
tt[i].flags |= str[0] ? TEXT_TRANSLATE : 0;
|
||||
|
||||
tt[i].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
lastt++;
|
||||
break;
|
||||
case 'N': /* store wires as lines on layer WIRELAYER. */
|
||||
|
|
|
|||
44
src/select.c
44
src/select.c
|
|
@ -323,7 +323,6 @@ void delete(int to_push_undo)
|
|||
int customfont;
|
||||
#endif
|
||||
double xx1,yy1,xx2,yy2;
|
||||
const char *txtptr;
|
||||
|
||||
dbg(3, "delete(): start\n");
|
||||
j = 0;
|
||||
|
|
@ -344,14 +343,7 @@ void delete(int to_push_undo)
|
|||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[i]);
|
||||
#endif
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
text_bbox(txtptr, xctx->text[i].xscale,
|
||||
text_bbox(xctx->text[i].txt_ptr, xctx->text[i].xscale,
|
||||
xctx->text[i].yscale, select_rot, select_flip, xctx->text[i].hcenter,
|
||||
xctx->text[i].vcenter, xctx->text[i].x0, xctx->text[i].y0,
|
||||
&xx1,&yy1, &xx2,&yy2, &tmp, &tmp);
|
||||
|
|
@ -626,19 +618,11 @@ void unselect_all(void)
|
|||
{
|
||||
if(xctx->text[i].sel == SELECTED)
|
||||
{
|
||||
const char *txtptr;
|
||||
xctx->text[i].sel = 0;
|
||||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(& xctx->text[i]); /* needed for bbox calculation */
|
||||
#endif
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
draw_temp_string(xctx->gctiled,ADD, txtptr,
|
||||
draw_temp_string(xctx->gctiled,ADD, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0, xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
|
|
@ -795,7 +779,6 @@ void select_text(int i,unsigned short select_mode, int fast)
|
|||
#if HAS_CAIRO==1
|
||||
int customfont;
|
||||
#endif
|
||||
const char *txtptr;
|
||||
|
||||
if(!fast) {
|
||||
my_strncpy(s,xctx->text[i].prop_ptr!=NULL?xctx->text[i].prop_ptr:"<NULL>",S(s));
|
||||
|
|
@ -809,21 +792,13 @@ void select_text(int i,unsigned short select_mode, int fast)
|
|||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[i]);
|
||||
#endif
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
|
||||
if(select_mode)
|
||||
draw_temp_string(xctx->gc[SELLAYER],ADD, txtptr,
|
||||
draw_temp_string(xctx->gc[SELLAYER],ADD, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0, xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
else
|
||||
draw_temp_string(xctx->gctiled,NOW, txtptr,
|
||||
draw_temp_string(xctx->gctiled,NOW, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0, xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
|
|
@ -1019,7 +994,6 @@ void select_inside(double x1,double y1, double x2, double y2, int sel) /*added u
|
|||
#if HAS_CAIRO==1
|
||||
int customfont;
|
||||
#endif
|
||||
const char *txtptr;
|
||||
|
||||
en_s = tclgetboolvar("enable_stretch");
|
||||
for(i=0;i<xctx->wires;i++)
|
||||
|
|
@ -1047,15 +1021,7 @@ void select_inside(double x1,double y1, double x2, double y2, int sel) /*added u
|
|||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[i]);
|
||||
#endif
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
|
||||
text_bbox(txtptr,
|
||||
text_bbox(xctx->text[i].txt_ptr,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale, select_rot, select_flip,
|
||||
xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0, xctx->text[i].y0,
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ void svg_draw(void)
|
|||
int c,i, textlayer;
|
||||
int old_grid;
|
||||
static char lastdir[PATH_MAX] = "";
|
||||
const char *r, *textfont, *txtptr;
|
||||
const char *r, *textfont;
|
||||
int *unused_layer;
|
||||
int color;
|
||||
Hilight_hashentry *entry;
|
||||
|
|
@ -744,20 +744,14 @@ void svg_draw(void)
|
|||
my_snprintf(svg_font_style, S(svg_font_style), "italic");
|
||||
if( xctx->text[i].flags & TEXT_OBLIQUE)
|
||||
my_snprintf(svg_font_style, S(svg_font_style), "oblique");
|
||||
if(xctx->text[i].flags & TEXT_TRANSLATE) {
|
||||
const char *inst;
|
||||
inst = get_tok_value(xctx->text[i].prop_ptr, "inst", 0);
|
||||
txtptr = translate(atoi(inst), xctx->text[i].txt_ptr);
|
||||
} else {
|
||||
txtptr = xctx->text[i].txt_ptr;
|
||||
}
|
||||
|
||||
if(text_svg)
|
||||
svg_draw_string(textlayer, txtptr,
|
||||
svg_draw_string(textlayer, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0,xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
else
|
||||
old_svg_draw_string(textlayer, txtptr,
|
||||
old_svg_draw_string(textlayer, xctx->text[i].txt_ptr,
|
||||
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
|
||||
xctx->text[i].x0,xctx->text[i].y0,
|
||||
xctx->text[i].xscale, xctx->text[i].yscale);
|
||||
|
|
|
|||
|
|
@ -266,8 +266,7 @@ extern char win_temp_dir[PATH_MAX];
|
|||
#define TEXT_OBLIQUE 2
|
||||
#define TEXT_ITALIC 4
|
||||
/* flag (.flags field) to hide text in symbols when displaying instances */
|
||||
#define TEXT_HIDE 8
|
||||
#define TEXT_TRANSLATE 16
|
||||
#define HIDE_TEXT 8
|
||||
|
||||
#define S(a) (sizeof(a)/sizeof(a[0]))
|
||||
#define BUS_WIDTH 4
|
||||
|
|
@ -464,7 +463,7 @@ typedef struct
|
|||
int layer; /* 20171201 for cairo */
|
||||
short hcenter, vcenter;
|
||||
char *font; /* 20171201 for cairo */
|
||||
int flags; /* TEXT_BOLD:1 TEXT_OBLIQUE:2 TEXT_ITALIC:4 TEXT_HIDE:8 */
|
||||
int flags; /* TEXT_BOLD:1 TEXT_OBLIQUE:2 TEXT_ITALIC:4 HIDE_TEXT:8 */
|
||||
} xText;
|
||||
|
||||
typedef struct
|
||||
|
|
|
|||
|
|
@ -217,8 +217,10 @@ C {lab_pin.sym} 700 -1200 0 1 {name=p32 lab=REFP}
|
|||
C {capa.sym} 260 -1100 0 0 {name=C3 m=1 value="100u"}
|
||||
C {res.sym} 130 -1220 1 1 {name=R11 m=1 value=0.3}
|
||||
C {res.sym} 130 -1060 1 1 {name=R9 m=1 value=0.3}
|
||||
C {res.sym} 550 -920 0 1 {name=R19 m=1 value='100k'}
|
||||
C {res.sym} 550 -860 0 1 {name=R0 m=1 value="'100k/gain'"}
|
||||
C {res.sym} 550 -920 0 1 {name=R19 m=1 value='100k'
|
||||
}
|
||||
C {res.sym} 550 -860 0 1 {name=R0 m=1 value="'100k/gain'"
|
||||
floaters=true}
|
||||
C {lab_pin.sym} 550 -750 0 0 {name=p108 lab=IN}
|
||||
C {mos_power_ampli.sym} 500 -660 0 0 {name=x1}
|
||||
C {lab_pin.sym} 350 -640 0 0 {name=p2 lab=VPP}
|
||||
|
|
|
|||
Loading…
Reference in New Issue