=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/engine2000/ChildView.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -p -r1.1.1.1 -r1.3 --- OpenXM_contrib2/windows/engine2000/ChildView.cpp 2000/11/22 06:20:13 1.1.1.1 +++ OpenXM_contrib2/windows/engine2000/ChildView.cpp 2002/10/02 09:33:31 1.3 @@ -96,7 +96,7 @@ void CChildView::OnPrint(CDC &dc) { DOCINFO docinfo; NODE n; - int width,height,ratio,x,y; + int width,height,ratio,x,y,step; memset(&docinfo,0,sizeof(DOCINFO)); docinfo.cbSize = sizeof(DOCINFO); @@ -123,7 +123,8 @@ void CChildView::OnPrint(CDC &dc) dc.StartPage(); if ( can->mode == MODE_INTERACTIVE ) { - // We want to associate precisely one printer pixel to + + // We want to associate a rectangle of a fixed size to // one bitmap pixel // if can->width/can->height > width/height // then match the widths, else match the height @@ -139,6 +140,7 @@ void CChildView::OnPrint(CDC &dc) dc.SetViewportOrg(width/18,height/18); dc.SetViewportExt(width,height); + step = (ratio+4)/5; for ( n = can->history; n; n = NEXT(n) ) { RealVect *rv = (RealVect *)n->body; if ( rv->len == 2 ) { @@ -146,7 +148,8 @@ void CChildView::OnPrint(CDC &dc) x = rv->body[0]*ratio; y = rv->body[1]*ratio; // dc.FillRect(CRect(x,y,x+1,y+1),&brush); - dc.FillRect(CRect(x-1,y-1,x+1,y+1),&brush); +// dc.FillRect(CRect(x-1,y-1,x+1,y+1),&brush); + dc.FillRect(CRect(x,y,x+step,y+step),&brush); } else if ( rv->len == 4 ) { dc.MoveTo(rv->body[0]*ratio,rv->body[1]*ratio); dc.LineTo(rv->body[2]*ratio,rv->body[3]*ratio); @@ -175,7 +178,7 @@ void CChildView::PrintAxis(CDC &dc) { #define D 5 - double w,w1,k,e,n; + double w,w1,e,n; int x0,y0,x,y,xadj,yadj; char buf[BUFSIZ]; @@ -204,7 +207,7 @@ void CChildView::PrintAxis(CDC &dc) w1 = w * DEFAULTWIDTH/can->width; e = adjust_scale(EXP10(floor(log10(w1))),w1); for ( n = ceil(can->xmin/e); n*e<= can->xmax; n++ ) { - x = (int)can->width*(n*e-can->xmin)/w; + x = (int)(can->width*(n*e-can->xmin)/w); dc.MoveTo(x,y0); dc.LineTo(x,y0-D); sprintf(buf,"%g",n*e); dc.TextOut(x+2,y0+2,buf,strlen(buf)); @@ -213,7 +216,7 @@ void CChildView::PrintAxis(CDC &dc) w1 = w * DEFAULTHEIGHT/can->height; e = adjust_scale(EXP10(floor(log10(w1))),w1); for ( n = ceil(can->ymin/e); n*e<= can->ymax; n++ ) { - y = (int)can->height*(1-(n*e-can->ymin)/w); + y = (int)(can->height*(1-(n*e-can->ymin)/w)); dc.MoveTo(x0,y); dc.LineTo(x0+D,y); sprintf(buf,"%g",n*e); if ( can->xmax <= 0 ) {