hide attribute for text items, not only if embedded in symbols

This commit is contained in:
Stefan Frederik 2022-02-21 10:53:06 +01:00
parent 77be19bc6a
commit 8be5ae7eb0
7 changed files with 10 additions and 9 deletions

View File

@ -2558,7 +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 : SYM_HIDE_TEXT;
t->flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
my_strdup(21, &t->font, get_tok_value(t->prop_ptr, "font", 0));
textlayer = t->layer;

View File

@ -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 & SYM_HIDE_TEXT) 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);
@ -3035,6 +3035,7 @@ void draw(void)
for(i=0;i<xctx->texts;i++)
{
textlayer = xctx->text[i].layer;
if(xctx->text[i].flags & HIDE_TEXT) continue;
if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER;
dbg(1, "draw(): drawing string %d = %s\n",i, xctx->text[i].txt_ptr);
#if HAS_CAIRO==1

View File

@ -958,7 +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 : SYM_HIDE_TEXT;
xctx->text[sel].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
if(k == 0 ) {
hsize =atof(tclgetvar("hsize"));
vsize =atof(tclgetvar("vsize"));

View File

@ -919,7 +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 : SYM_HIDE_TEXT;
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;

View File

@ -65,7 +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 : SYM_HIDE_TEXT;
xctx->text[i].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
select_text(i,SELECTED, 1);
set_modify(1);

View File

@ -1289,7 +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 : SYM_HIDE_TEXT;
xctx->text[i].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
xctx->texts++;
}
@ -2807,7 +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 : SYM_HIDE_TEXT;
tt[i].flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
lastt++;
break;
case 'N': /* store wires as lines on layer WIRELAYER. */

View File

@ -266,7 +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 SYM_HIDE_TEXT 8
#define HIDE_TEXT 8
#define S(a) (sizeof(a)/sizeof(a[0]))
#define BUS_WIDTH 4
@ -463,7 +463,7 @@ typedef struct
int layer; /* 20171201 for cairo */
short hcenter, vcenter;
char *font; /* 20171201 for cairo */
int flags;
int flags; /* TEXT_BOLD:1 TEXT_OBLIQUE:2 TEXT_ITALIC:4 HIDE_TEXT:8 */
} xText;
typedef struct