From c806289beec6598b009ab8fab7594593c9050d33 Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Thu, 7 Jan 2021 18:46:39 +0100 Subject: [PATCH] almost eliminated draw_hilight_net(1); draw() takes care of it faster --- src/actions.c | 18 ++++++++++++------ src/hilight.c | 5 +++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/actions.c b/src/actions.c index 59e883fd..7fb6457c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1611,6 +1611,7 @@ void restore_selection(double x1, double y1, double x2, double y2) void new_wire(int what, double mx_snap, double my_snap) { + int big = xctx->wires> 2000 || xctx->instances > 2000 ; if( (what & PLACE) ) { if( (xctx->ui_state & STARTWIRE) && (xctx->nl_x1!=xctx->nl_x2 || xctx->nl_y1!=xctx->nl_y2) ) { push_undo(); @@ -1659,16 +1660,21 @@ void new_wire(int what, double mx_snap, double my_snap) xctx->prep_hi_structs = 0; if(autotrim_wires) trim_wires(); update_conn_cues(1,1); - if(show_pin_net_names) { - prepare_netlist_structs(0); + if( xctx->hilight_nets || show_pin_net_names) prepare_netlist_structs(0); + if(!big) { + xRect boundbox; bbox(START , 0.0 , 0.0 , 0.0 , 0.0); + if( xctx->hilight_nets ) calc_drawing_bbox(&boundbox, 2); + bbox(ADD, boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2); + } + if(show_pin_net_names) { int_hash_lookup(xctx->node_redraw_table, xctx->wire[xctx->wires-1].node, 0, XINSERT_NOREPLACE); find_inst_to_be_redrawn(); - bbox(SET , 0.0 , 0.0 , 0.0 , 0.0); - draw(); - bbox(END , 0.0 , 0.0 , 0.0 , 0.0); } - draw_hilight_net(1);/* for updating connection bubbles on hilight nets */ + if(!big) bbox(SET , 0.0 , 0.0 , 0.0 , 0.0); + draw(); + if(!big) bbox(END , 0.0 , 0.0 , 0.0 , 0.0); + /* draw_hilight_net(1);*/ /* for updating connection bubbles on hilight nets */ } if(! (what &END)) { xctx->nl_x1=mx_snap; diff --git a/src/hilight.c b/src/hilight.c index f8b7986c..d77e32b3 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -462,6 +462,10 @@ int bus_search(const char*s) return bus; } +/* sel: -1 --> unselect + * 1 --> select + * 0 --> highlight + */ int search(const char *tok, const char *val, int sub, int sel) { int save_draw; @@ -478,6 +482,7 @@ int search(const char *tok, const char *val, int sub, int sel) regex_t re; #endif + /* when unselecting selected area should be redrawn */ if(sel == -1 && !big) { calc_drawing_bbox(&boundbox, 1); }