From ac4e7fc7fb87653d2d17f738835e31a81c0b358c Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Mon, 22 Sep 2025 14:23:27 +0200 Subject: [PATCH] inserting a wave with Add button in graphdialog will preserve previous wave colors --- src/xschem.tcl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/xschem.tcl b/src/xschem.tcl index d0aa5cff..f49da6fd 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -3030,7 +3030,7 @@ proc graph_add_nodes_from_list {nodelist} { # add nodes from left listbox proc graph_add_nodes {} { - global graph_bus + global graph_bus graph_sel_color graph_selected set sel_idx [.graphdialog.center.left.list1 curselection] set sel {} if {$graph_bus} { @@ -3059,7 +3059,17 @@ proc graph_add_nodes {} { set sel "${sel}\n" } if {$change_done} { + set tag [.graphdialog.center.right.text1 tag names insert] + if { $tag eq {}} {set tag [.graphdialog.center.right.text1 tag names {insert - 1 char}]} .graphdialog.center.right.text1 insert {insert lineend + 1 char} $sel + # insert $graph_sel_color colors along with inserted nodes, so previous wave colors are preserved + if { [regexp {^t} $tag]} { + set index [string range $tag 1 end] + incr index + set col [xschem getprop rect 2 $graph_selected color] + set col [linsert $col $index $graph_sel_color] + xschem setprop -fast rect 2 $graph_selected color $col + } } }