From 9b4534d6b08ffb4b205b04ee7a29dc03b5d4883c Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Sat, 26 Dec 2020 22:29:45 +0100 Subject: [PATCH] A change_linewidth(-1.0) is added after resetwin() creates a new pixmap (example: after a window resize) . This sets colors, backgrounds fill styles for the new pixmap. --- src/actions.c | 2 +- src/xinit.c | 4 +++- xschem_library/xschem_simulator/logic_test.sch | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/actions.c b/src/actions.c index 411dd1d7..b5c48059 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1369,7 +1369,7 @@ void zoom_full(int dr, int sel, int flags, double shrink) xctx->xorigin = -boundbox.x1 + (1 - shrink) / 2 * xctx->zoom * schw; xctx->yorigin = -boundbox.y1 + xctx->zoom * schh - bboxh - (1 - shrink) / 2 * xctx->zoom * schh; } - dbg(1, "zoom_full(): areaw=%d, areah=%d\n", xctx->areaw, xctx->areah); + dbg(1, "zoom_full(): dr=%d sel=%d flags=%d areaw=%d, areah=%d\n", sel, dr, flags, xctx->areaw, xctx->areah); if(flags & 1) change_linewidth(-1.); if(dr && has_x) draw(); } diff --git a/src/xinit.c b/src/xinit.c index 3c4d7403..b3051815 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1006,7 +1006,7 @@ void resetwin(int create_pixmap, int clear_pixmap, int force, int w, int h) xctx->areah = xctx->areay2-xctx->areay1; /* if no force avoid unnecessary work if no resize */ if( force || xctx->xschem_w !=xctx->xrect[0].width || xctx->xschem_h !=xctx->xrect[0].height) { - dbg(1, "resetwin(): %d, %d, %d, xschem_w=%d xschem_h=%d\n", + dbg(1, "resetwin(): create: %d, clear: %d, force: %d, xschem_w=%d xschem_h=%d\n", create_pixmap, clear_pixmap, force, xctx->xschem_w,xctx->xschem_h); dbg(1, "resetwin(): changing size\n\n"); xctx->xrect[0].x = 0; @@ -1031,6 +1031,8 @@ void resetwin(int create_pixmap, int clear_pixmap, int force, int w, int h) xctx->gctiled = XCreateGC(display,xctx->window,0L, NULL); XSetTile(display,xctx->gctiled, xctx->save_pixmap); XSetFillStyle(display,xctx->gctiled,FillTiled); + /* whenever a pixmap is recreated all GC attributes must be reissued */ + change_linewidth(-1.0); resetcairo(1, 0, 1); /* create, clear, force */ } } diff --git a/xschem_library/xschem_simulator/logic_test.sch b/xschem_library/xschem_simulator/logic_test.sch index 57e50645..2434041c 100644 --- a/xschem_library/xschem_simulator/logic_test.sch +++ b/xschem_library/xschem_simulator/logic_test.sch @@ -628,7 +628,7 @@ tclcommand=" set count 0 update ;# allow event loop to come in (update screen, user input etc) incr count after 500 - if \{$count==300 || $tclstop == 1\} break + if \{$count==30 || $tclstop == 1\} break xschem logic_set $logic_value set logic_value [expr !$logic_value] \}