From 7b12159e0cd16d8b17de53e652cc5078e31d5021 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sun, 21 May 2023 00:07:08 +0200 Subject: [PATCH] do not add hidden texts in symbol bboxes (symbol_bbox()) --- src/select.c | 3 ++- src/xschem.tcl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/select.c b/src/select.c index f119a4e7..c59ad8dd 100644 --- a/src/select.c +++ b/src/select.c @@ -164,9 +164,10 @@ void symbol_bbox(int i, double *x1,double *y1, double *x2, double *y2) /* strings bbox */ for(j=0;j< (xctx->inst[i].ptr+ xctx->sym)->texts; ++j) { + text = (xctx->inst[i].ptr+ xctx->sym)->text[j]; + if(!xctx->show_hidden_texts && (text.flags & HIDE_TEXT)) continue; sym_flip = flip; sym_rot = rot; - text = (xctx->inst[i].ptr+ xctx->sym)->text[j]; /* dbg(2, "symbol_bbox(): instance %d text n: %d text str=%s\n", i,j, text.txt_ptr? text.txt_ptr:"NULL"); */ tmp_txt = translate(i, text.txt_ptr); /* dbg(2, "symbol_bbox(): translated text: %s\n", tmp_txt); */ diff --git a/src/xschem.tcl b/src/xschem.tcl index 58208236..2340f8ba 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -3708,7 +3708,7 @@ proc tclpropeval2 {s} { # puts "tclpropeval2: s=|$s|" # puts "tclpropeval2: subst $s=|[subst $s]|" if { [catch {uplevel #0 "subst \{$s\}"} res] } { - if { $debug_var<=-1 } { puts "tclpropeval2 warning: $res"} + if { $debug_var<=-1 } { puts "tclpropeval2 warning: $s --> $res"} set res ?\n } # puts "tclpropeval2: res=|$res|" @@ -5979,7 +5979,7 @@ proc build_widgets { {topwin {} } } { xschem redraw } $topwin.menubar.view.menu add checkbutton -label "Show hidden texts" -variable show_hidden_texts \ - -command {xschem redraw} + -command {xschem update_all_sym_bboxes; xschem redraw} $topwin.menubar.view.menu add command -label "Change current layer color" -accelerator {} -command { change_color }