From 40d8b960f3bcdb4504fefd5954d6596cea4caf96 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 23 Jun 2023 23:36:11 +0200 Subject: [PATCH] fix initial full zoom of schematics loaded with xschem load file from the xschem tcl prompt --- src/scheduler.c | 4 ++++ src/select.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/scheduler.c b/src/scheduler.c index 1aa8808a..e5753ffa 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1973,6 +1973,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(!undo_reset) xctx->push_undo(); xctx->currsch = 0; remove_symbols(); + xctx->zoom=CADINITIALZOOM; + xctx->mooz=1/CADINITIALZOOM; + xctx->xorigin=CADINITIALX; + xctx->yorigin=CADINITIALY; dbg(1, "scheduler: undo_reset=%d\n", undo_reset); load_schematic(load_symbols, f, undo_reset, !force); tclvareval("update_recent_file {", f, "}", NULL); diff --git a/src/select.c b/src/select.c index 95acc89c..afd6d3e1 100644 --- a/src/select.c +++ b/src/select.c @@ -179,6 +179,8 @@ void symbol_bbox(int i, double *x1,double *y1, double *x2, double *y2) (text.rot + ( (sym_flip && (text.rot & 1) ) ? sym_rot+2 : sym_rot)) &0x3, sym_flip ^ text.flip, text.hcenter, text.vcenter, x0+text_x0,y0+text_y0, &xx1,&yy1,&xx2,&yy2, &tmp, &dtmp); + dbg(1, "symbol bbox: text bbox: %s, %g %g %g %g\n", tmp_txt, xx1, yy1, xx2, yy2); + dbg(1, "symbol bbox: text bbox: zoom=%g, lw=%g\n", xctx->zoom, xctx->lw); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx);