fix wrong #ifdef instead of #if in psprint

This commit is contained in:
Stefan Frederik 2022-01-19 12:15:33 +01:00
parent 98bfb90e11
commit 03c5330c94
3 changed files with 48 additions and 2 deletions

View File

@ -2561,6 +2561,48 @@ void draw_graph_all(int flags)
}
}
int draw_images_all(void)
{
#if HAS_CAIRO==1
int i, bbox_set = 0;
int save_bbx1, save_bby1, save_bbx2, save_bby2;
if(xctx->sem) {
bbox_set = 1;
save_bbx1 = xctx->bbx1;
save_bby1 = xctx->bby1;
save_bbx2 = xctx->bbx2;
save_bby2 = xctx->bby2;
bbox(END, 0.0, 0.0, 0.0, 0.0);
}
cairo_save(xctx->cairo_ctx);
cairo_save(xctx->cairo_save_ctx);
if(xctx->draw_single_layer==-1 || GRIDLAYER == xctx->draw_single_layer) {
if(xctx->enable_layer[GRIDLAYER]) for(i = 0; i < xctx->rects[GRIDLAYER]; i++) {
xRect *r = &xctx->rect[GRIDLAYER][i];
if(r->flags & 1024) {
/* const char *filename = get_tok_value(r->prop_ptr, "image", 0); */
}
}
}
cairo_restore(xctx->cairo_ctx);
cairo_restore(xctx->cairo_save_ctx);
if(bbox_set) {
xctx->bbx1 = save_bbx1;
xctx->bby1 = save_bby1;
xctx->bbx2 = save_bbx2;
xctx->bby2 = save_bby2;
xctx->sem = 1;
bbox(SET, 0.0, 0.0, 0.0, 0.0);
}
#endif
return 0;
}
void draw(void)
{
/* inst_ptr and wire hash iterator 20171224 */

View File

@ -351,7 +351,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
ascent = size*xctx->mooz * 0.808; /* was 0.908 */
descent = size*xctx->mooz * 0.219; /* was 0.219 */
#ifdef HAS_CAIRO==1
#if HAS_CAIRO==1
if(!has_x)
text_bbox_nocairo(str, xscale, yscale, rot, flip, hcenter, vcenter,
x,y, &textx1,&texty1,&textx2,&texty2, &no_of_lines, &longest_line);

View File

@ -404,7 +404,10 @@ typedef struct
unsigned short sel;
char *prop_ptr;
short dash;
unsigned short flags; /* bit0=1 for graph function, bit1=1 for unlocked x axis */
/* bit0=1 for graph function, bit1=1 for unlocked x axis
* bit10: image embedding (png)
*/
unsigned short flags;
} xRect;
typedef struct
@ -994,6 +997,7 @@ extern double get_raw_value(int dataset, int idx, int point);
extern int schematic_waves_loaded(void);
extern void draw_graph(int i, int flags, Graph_ctx *gr);
extern void draw_graph_all(int flags);
extern int draw_images_all(void);
extern void setup_graph_data(int i, const int flags, int skip, Graph_ctx *gr);
extern void free_rawfile(int dr);
extern int read_rawfile(const char *f);