diff --git a/src/actions.c b/src/actions.c index 203f7cf0..68693290 100644 --- a/src/actions.c +++ b/src/actions.c @@ -2874,6 +2874,8 @@ void zoom_full(int dr, int sel, int flags, double shrink) xctx->yorigin = -boundbox.y1 + xctx->zoom * schh - bboxh - (1 - shrink) / 2 * xctx->zoom * schh; } dbg(1, "zoom_full(): dr=%d sel=%d flags=%d areaw=%d, areah=%d\n", sel, dr, flags, xctx->areaw, xctx->areah); + dbg(1, "zoom_full(): zoom=%g, xor=%g, yor=%g\n", xctx->zoom, xctx->xorigin, xctx->yorigin); + dbg(1, "zoom_full(): current_name=%s\n", xctx->current_name); if(flags & 1) change_linewidth(-1.); /* we do this here since change_linewidth may not be called if flags & 1 == 0*/ xctx->cadhalfdotsize = CADHALFDOTSIZE * (cs < 20. ? cs : 20.) / 10.; @@ -2938,6 +2940,7 @@ void save_restore_zoom(int save, Zoom_info *zi) { if(save) { dbg(1, "save_restore_zoom: save width= %d, height=%d\n", xctx->xrect[0].width, xctx->xrect[0].height); + dbg(1, " zoom=%g\n", xctx->zoom); zi->savew = xctx->xrect[0].width; zi->saveh = xctx->xrect[0].height; zi->savelw = xctx->lw; @@ -2961,6 +2964,7 @@ void save_restore_zoom(int save, Zoom_info *zi) xctx->yorigin = zi->saveyor; xctx->zoom = zi->savezoom; xctx->mooz = 1 / zi->savezoom; + dbg(1, " zoom=%g\n", xctx->zoom); } } diff --git a/src/psprint.c b/src/psprint.c index c56d2378..217e8cc4 100644 --- a/src/psprint.c +++ b/src/psprint.c @@ -301,7 +301,7 @@ static int ps_embedded_graph(int i, double rx1, double ry1, double rx2, double r } rwi = (int)(rw * scale + 1.0); rhi = (int)(rh * scale + 1.0); - dbg(1, "graph size: %dx%d\n", rwi, rhi); + dbg(1, "graph size, saving zoom : %dx%d\n", rwi, rhi); save_restore_zoom(1, &zi); set_viewport_size(rwi, rhi, xctx->lw); @@ -353,6 +353,7 @@ static int ps_embedded_graph(int i, double rx1, double ry1, double rx2, double r tclsetboolvar("draw_grid", save_draw_grid); save_restore_zoom(0, &zi); resetwin(1, 1, 1, xctx->xrect[0].width, xctx->xrect[0].height); + dbg(1, "restore zoom + resetwin: %dx%d\n", xctx->xrect[0].width, xctx->xrect[0].height); change_linewidth(xctx->lw); tclsetboolvar("dark_colorscheme", d_c); build_colors(0, 0); @@ -1276,7 +1277,7 @@ void create_ps(char **psfile, int what, int fullzoom, int eps) xctx->xrect[0].height = (short unsigned int) (xctx->xrect[0].width * pagey / pagex); else xctx->xrect[0].width = (short unsigned int) (xctx->xrect[0].height * pagey / pagex); - dbg(1, "create_ps(): xrect.width=%d, xrect.height=%d\n", xctx->xrect[0].width, xctx->xrect[0].height); + dbg(1, "create_ps(): save zoom, r.width=%d, r.height=%d\n", xctx->xrect[0].width, xctx->xrect[0].height); xctx->areax1 = -2*INT_LINE_W(xctx->lw); xctx->areay1 = -2*INT_LINE_W(xctx->lw); xctx->areax2 = xctx->xrect[0].width+2*INT_LINE_W(xctx->lw); @@ -1592,6 +1593,7 @@ void create_ps(char **psfile, int what, int fullzoom, int eps) save_restore_zoom(0, &zi); resetwin(1, 1, 1, 0, 0); change_linewidth(xctx->lw); + zoom_full(1, 0, 0 + 2 * tclgetboolvar("zoom_full_center"), 0.97); } } diff --git a/src/spice_netlist.c b/src/spice_netlist.c index 835ca7b8..776f51eb 100644 --- a/src/spice_netlist.c +++ b/src/spice_netlist.c @@ -106,7 +106,9 @@ void hier_psprint(char **res, int what) /* netlister driver */ dbg(1, "hier_psprint(): loading file: |%s|\n", filename); load_schematic(1,filename, 0, 1); get_additional_symbols(1); - zoom_full(0, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); + /* do a zoom with draw, this is needed to load embedded images into r->extraptr + * | */ + zoom_full(1, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); if(what & 1) ps_draw(2, 1, 0); /* page */ if(what & 2) { /* print cellname */ my_strcat(_ALLOC_ID_, res, hier_psprint_mtime(xctx->sch[xctx->currsch])); @@ -133,8 +135,6 @@ void hier_psprint(char **res, int what) /* netlister driver */ xctx->prev_set_modify = save_prev_mod; my_strncpy(xctx->current_name, rel_sym_path(xctx->sch[xctx->currsch]), S(xctx->current_name)); xctx->do_copy_area = save; - zoom_full(0, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); - draw(); if(what & 1) ps_draw(4, 1, 0); /* trailer */ }