Commit 145b2825 authored by claes's avatar claes

Correction of position

parent 551fcf61
...@@ -31,9 +31,9 @@ void FlowArc::traverse( int x, int y) ...@@ -31,9 +31,9 @@ void FlowArc::traverse( int x, int y)
void FlowArc::print( void *pos, void *node) void FlowArc::print( void *pos, void *node)
{ {
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ctx->print_zoom_factor / ctx->base_zoom_factor *
line_width - 1); line_width;
idx = MAX( 0, idx); idx = MAX( 0.5, idx);
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
ctx->print_ps->arc( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->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,
......
...@@ -92,9 +92,9 @@ void FlowArrow::traverse( int x, int y) ...@@ -92,9 +92,9 @@ void FlowArrow::traverse( int x, int y)
void FlowArrow::print( void *pos, void *node) void FlowArrow::print( void *pos, void *node)
{ {
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ctx->print_zoom_factor / ctx->base_zoom_factor *
line_width - 1); line_width;
idx = MAX( 0, idx); idx = MAX( 0.5, idx);
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
ctx->print_ps->arrow( ctx->print_ps->arrow(
p_dest.print_z_x + ((FlowPoint *)pos)->print_z_x, p_dest.print_z_x + ((FlowPoint *)pos)->print_z_x,
......
...@@ -23,12 +23,12 @@ int FlowImage::insert_image( char *imagefile) ...@@ -23,12 +23,12 @@ int FlowImage::insert_image( char *imagefile)
strcpy( image_filename, imagefile); strcpy( image_filename, imagefile);
// Look for file in $pwrp_exe, $pwr_doc and $pwr_exe // Look for file in $pwrp_exe, $pwr_doc/orm and $pwr_exe
for ( int i = 0; i < 3; i++) { for ( int i = 0; i < 3; i++) {
switch( i) { switch( i) {
case 1: strcpy( filename, "$pwrp_exe/"); break; case 0: strcpy( filename, "$pwrp_exe/"); break;
case 2: strcpy( filename, "$pwr_doc/"); break; case 1: strcpy( filename, "$pwr_doc/orm/"); break;
case 3: strcpy( filename, "$pwr_exe/"); break; case 2: strcpy( filename, "$pwr_exe/"); break;
} }
strcat( filename, imagefile); strcat( filename, imagefile);
dcli_translate_filename( filename, filename); dcli_translate_filename( filename, filename);
......
...@@ -32,8 +32,8 @@ void FlowLine::print( void *pos, void *node) ...@@ -32,8 +32,8 @@ void FlowLine::print( void *pos, void *node)
{ {
if ( p1.print_z_x == p2.print_z_x && p1.print_z_y == p2.print_z_y) if ( p1.print_z_x == p2.print_z_x && p1.print_z_y == p2.print_z_y)
return; return;
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * double idx = ctx->print_zoom_factor / ctx->base_zoom_factor *
line_width - 1); line_width;
idx = MAX( 0, idx); idx = MAX( 0, idx);
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
ctx->print_ps->line( p1.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->line( p1.print_z_x + ((FlowPoint *)pos)->print_z_x,
......
...@@ -15,10 +15,10 @@ void FlowPoint::posit( double x1, double y1) ...@@ -15,10 +15,10 @@ void FlowPoint::posit( double x1, double y1)
{ {
x = x1; x = x1;
y = y1; y = y1;
z_x = int( x * ctx->zoom_factor); z_x = int( x * ctx->zoom_factor + 0.5);
z_y = int( y * ctx->zoom_factor); z_y = int( y * ctx->zoom_factor + 0.5);
nav_z_x = int( x * ctx->nav_zoom_factor); nav_z_x = int( x * ctx->nav_zoom_factor + 0.5);
nav_z_y = int( y * ctx->nav_zoom_factor); nav_z_y = int( y * ctx->nav_zoom_factor + 0.5);
} }
void FlowPoint::posit_z( int x1, int y1) void FlowPoint::posit_z( int x1, int y1)
...@@ -33,15 +33,15 @@ void FlowPoint::posit_z( int x1, int y1) ...@@ -33,15 +33,15 @@ void FlowPoint::posit_z( int x1, int y1)
void FlowPoint::zoom() void FlowPoint::zoom()
{ {
z_x = int( x * ctx->zoom_factor); z_x = int( x * ctx->zoom_factor + 0.5);
z_y = int( y * ctx->zoom_factor); z_y = int( y * ctx->zoom_factor + 0.5);
current_zoom_factor = ctx->zoom_factor; current_zoom_factor = ctx->zoom_factor;
} }
void FlowPoint::nav_zoom() void FlowPoint::nav_zoom()
{ {
nav_z_x = int( x * ctx->nav_zoom_factor); nav_z_x = int( x * ctx->nav_zoom_factor + 0.5);
nav_z_y = int( y * ctx->nav_zoom_factor); nav_z_y = int( y * ctx->nav_zoom_factor + 0.5);
} }
void FlowPoint::print_zoom() void FlowPoint::print_zoom()
......
...@@ -37,9 +37,8 @@ void FlowRect::print( void *pos, void *node) ...@@ -37,9 +37,8 @@ void FlowRect::print( void *pos, void *node)
return; return;
if ( draw_type == flow_eDrawType_LineErase) if ( draw_type == flow_eDrawType_LineErase)
return; return;
int idx = int( ctx->print_zoom_factor / ctx->base_zoom_factor * line_width - double idx = ctx->print_zoom_factor / ctx->base_zoom_factor * line_width;
1); 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)
ctx->print_ps->rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x, ctx->print_ps->rect( ll.print_z_x + ((FlowPoint *)pos)->print_z_x,
......
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