if selection is present when exporting pdf assume it is a bboxed pdf, do not print page title. Fix set_viewport_size setting line width to 1 instead of using current value

This commit is contained in:
stefan schippers 2023-12-11 18:28:23 +01:00
parent b95289ca5e
commit 379938fe03
2 changed files with 7 additions and 7 deletions

View File

@ -1149,7 +1149,7 @@ void create_ps(char **psfile, int what, int fullzoom)
fprintf(fd, "%%%%EndPageSetup\n");
/* add small page title */
if(tclgetboolvar("ps_page_title"))
if(tclgetboolvar("ps_page_title") && fullzoom != 2)
fprintf(fd, "/Helvetica FF 10 SCF SF NP 20 %g MT (%s) show\n", pagey - 20, xctx->current_name);
/* Add anchor for pdfmarks */

View File

@ -3078,13 +3078,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(w == 0) w = xctx->xrect[0].width;
if(h == 0) h = xctx->xrect[0].height;
save_restore_zoom(1, &zi);
set_viewport_size(w, h, 1.0);
set_viewport_size(w, h, xctx->lw);
zoom_full(0, 0, 2 * tclgetboolvar("zoom_full_center"), 0.97);
resetwin(1, 1, 1, w, h);
ps_draw(7, fullzoom);
save_restore_zoom(0, &zi);
resetwin(1, 1, 1, 0, 0);
change_linewidth(-1.);
change_linewidth(save_lw);
} else if(argc == 10 || xctx->lastsel) {
if(xctx->lastsel) {
xRect boundbox;
@ -3108,7 +3108,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(w == 0) w = (int) fabs(x2 - x1);
if(h == 0) h = (int) fabs(y2 - y1);
save_restore_zoom(1, &zi);
set_viewport_size(w, h, 1.0);
set_viewport_size(w, h, xctx->lw);
zoom_box(x1, y1, x2, y2, 1.0);
resetwin(1, 1, 1, w, h);
ps_draw(7, fullzoom);
@ -3134,13 +3134,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(w == 0) w = xctx->xrect[0].width;
if(h == 0) h = xctx->xrect[0].height;
save_restore_zoom(1, &zi);
set_viewport_size(w, h, 1.0);
set_viewport_size(w, h, xctx->lw);
zoom_full(0, 0, 2 * tclgetboolvar("zoom_full_center"), 0.97);
resetwin(1, 1, 1, w, h);
print_image();
save_restore_zoom(0, &zi);
resetwin(1, 1, 1, 0, 0);
change_linewidth(-1.);
change_linewidth(save_lw);
} else if(argc == 10 || xctx->lastsel) {
if(xctx->lastsel) {
xRect boundbox;
@ -3163,7 +3163,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(w == 0) w = (int) fabs(x2 - x1);
if(h == 0) h = (int) fabs(y2 - y1);
save_restore_zoom(1, &zi);
set_viewport_size(w, h, 1.0);
set_viewport_size(w, h, xctx->lw);
zoom_box(x1, y1, x2, y2, 1.0);
resetwin(1, 1, 1, w, h);
print_image();