Commit e346434b authored by claes's avatar claes

Pdf text size and line width corrected

parent a0c4d8ee
/* /*
* Proview $Id: flow_annot.cpp,v 1.7 2007-09-25 13:11:00 claes Exp $ * Proview $Id: flow_annot.cpp,v 1.8 2007-09-25 16:36:21 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -55,9 +55,9 @@ void FlowAnnot::print( void *pos, void *node, int highlight) ...@@ -55,9 +55,9 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
return; return;
if ( !((FlowNode *) node)->annotv[number]) if ( !((FlowNode *) node)->annotv[number])
return; return;
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ( ctx->print_zoom_factor / ctx->base_zoom_factor *
(text_size +4) - 4); (text_size +4) - 4);
int size = int( 8.0 + 6.0/3*idx); double size = 8.0 + 6.0/3*idx;
double x; double x;
if ( size <= 0) if ( size <= 0)
......
/* /*
* Proview $Id: flow_arc.cpp,v 1.7 2007-09-25 13:11:00 claes Exp $ * Proview $Id: flow_arc.cpp,v 1.8 2007-09-25 16:36:21 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -52,7 +52,7 @@ void FlowArc::print( void *pos, void *node, int highlight) ...@@ -52,7 +52,7 @@ void FlowArc::print( void *pos, void *node, int highlight)
{ {
double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ctx->print_zoom_factor / ctx->base_zoom_factor *
line_width; line_width;
idx = MAX( 0.5, idx); idx = MAX( 0, idx);
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
ctx->current_print->arc( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->current_print->arc( ll.print_z_x + ((FlowPoint *)pos)->print_z_x,
ll.print_z_y + ((FlowPoint *)pos)->print_z_y, ll.print_z_y + ((FlowPoint *)pos)->print_z_y,
......
/* /*
* Proview $Id: flow_arrow.cpp,v 1.7 2007-09-25 13:11:00 claes Exp $ * Proview $Id: flow_arrow.cpp,v 1.8 2007-09-25 16:36:21 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -113,7 +113,7 @@ void FlowArrow::print( void *pos, void *node, int highlight) ...@@ -113,7 +113,7 @@ void FlowArrow::print( void *pos, void *node, int highlight)
{ {
double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ctx->print_zoom_factor / ctx->base_zoom_factor *
line_width; line_width;
idx = MAX( 0.5, idx); idx = MAX( 0, idx);
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
ctx->current_print->arrow( ctx->current_print->arrow(
p_dest.print_z_x + ((FlowPoint *)pos)->print_z_x, p_dest.print_z_x + ((FlowPoint *)pos)->print_z_x,
......
/* /*
* Proview $Id: flow_pdf.cpp,v 1.2 2007-09-25 14:23:51 claes Exp $ * Proview $Id: flow_pdf.cpp,v 1.3 2007-09-25 16:36:21 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -132,7 +132,7 @@ int FlowPdf::text( double x, double y, char *text, int len, flow_eDrawType type, ...@@ -132,7 +132,7 @@ int FlowPdf::text( double x, double y, char *text, int len, flow_eDrawType type,
t[tlen] = 0; t[tlen] = 0;
int bold = (type == flow_eDrawType_TextHelveticaBold); int bold = (type == flow_eDrawType_TextHelveticaBold);
topdf->draw_text( x - offset_x , offset_y - y, t, bold, 0.87 * size); topdf->draw_text( x - offset_x , offset_y - y, t, bold, size);
return 1; return 1;
} }
......
/* /*
* Proview $Id: flow_pscript.cpp,v 1.6 2007-09-25 13:11:00 claes Exp $ * Proview $Id: flow_pscript.cpp,v 1.7 2007-09-25 16:36:21 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -121,6 +121,8 @@ int FlowPscript::print_page( double ll_x, double ll_y, double ur_x, double ur_y) ...@@ -121,6 +121,8 @@ int FlowPscript::print_page( double ll_x, double ll_y, double ur_x, double ur_y)
int FlowPscript::rect( double x, double y, double width, double height, flow_eDrawType type, int FlowPscript::rect( double x, double y, double width, double height, flow_eDrawType type,
double idx, int highlight) double idx, int highlight)
{ {
idx = MAX( 0.5, idx);
if ( type == flow_eDrawType_LineDashed) if ( type == flow_eDrawType_LineDashed)
{ {
fprintf( file, "gsave\n"); fprintf( file, "gsave\n");
...@@ -185,6 +187,8 @@ int FlowPscript::arc( double x, double y, double width, double height, int angel ...@@ -185,6 +187,8 @@ int FlowPscript::arc( double x, double y, double width, double height, int angel
double r = 0.5*width; double r = 0.5*width;
double pi = 3.14159; double pi = 3.14159;
idx = MAX( 0.5, idx);
if ( type == flow_eDrawType_LineDashed) if ( type == flow_eDrawType_LineDashed)
{ {
fprintf( file, "gsave\n"); fprintf( file, "gsave\n");
...@@ -351,6 +355,7 @@ int FlowPscript::pixmap( double x, double y, flow_sPixmapDataElem *data, ...@@ -351,6 +355,7 @@ int FlowPscript::pixmap( double x, double y, flow_sPixmapDataElem *data,
int FlowPscript::arrow( double x1, double y1, double x2, double y2, int FlowPscript::arrow( double x1, double y1, double x2, double y2,
double x3, double y3, flow_eDrawType type, double idx) double x3, double y3, flow_eDrawType type, double idx)
{ {
idx = MAX( 0.5, idx);
if ( type == flow_eDrawType_LineGray) if ( type == flow_eDrawType_LineGray)
{ {
......
/* /*
* Proview $Id: flow_rect.cpp,v 1.8 2007-09-25 13:11:00 claes Exp $ * Proview $Id: flow_rect.cpp,v 1.9 2007-09-25 16:36:21 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -58,7 +58,7 @@ void FlowRect::print( void *pos, void *node, int highlight) ...@@ -58,7 +58,7 @@ void FlowRect::print( void *pos, void *node, int highlight)
if ( draw_type == flow_eDrawType_LineErase) if ( draw_type == flow_eDrawType_LineErase)
return; return;
double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * line_width; double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * line_width;
idx = MAX( 0.5, idx); idx = MAX( 0, idx);
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
if ( !fill) if ( !fill)
......
/* /*
* Proview $Id: flow_text.cpp,v 1.6 2007-09-25 13:11:00 claes Exp $ * Proview $Id: flow_text.cpp,v 1.7 2007-09-25 16:36:21 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -46,7 +46,7 @@ void FlowText::traverse( int x, int y) ...@@ -46,7 +46,7 @@ void FlowText::traverse( int x, int y)
void FlowText::print( void *pos, void *node, int highlight) void FlowText::print( void *pos, void *node, int highlight)
{ {
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ( ctx->print_zoom_factor / ctx->base_zoom_factor *
(text_size +4) - 4); (text_size +4) - 4);
double size = 8.0 + 6.0/3*idx; double size = 8.0 + 6.0/3*idx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment