fix initial full zoom of schematics loaded with xschem load file from the xschem tcl prompt

This commit is contained in:
stefan schippers 2023-06-23 23:36:11 +02:00
parent 0f3a0c62a8
commit 40d8b960f3
2 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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);