Commit 145b2825 authored by claes's avatar claes

Correction of position

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