From: <jam...@us...> - 2007-01-24 23:14:37
|
Revision: 25 http://svn.sourceforge.net/nplot/?rev=25&view=rev Author: jamcquay Date: 2007-01-24 15:14:35 -0800 (Wed, 24 Jan 2007) Log Message: ----------- Fixed [SF patch 1622687] On large zoom levels it may happen that one part of the points is behind the left edge of the plot area while the rest is behind the right edge. Still the line between two points closest to the left and right edge should be drawn as it could fall within the viewport of the plot area. Currently, the line simply disappears. Code fixed by: konieczp Signed off by: jamcquay Modified Paths: -------------- trunk/src/LinePlot.cs trunk/src/StepPlot.cs Modified: trunk/src/LinePlot.cs =================================================================== --- trunk/src/LinePlot.cs 2007-01-24 23:02:37 UTC (rev 24) +++ trunk/src/LinePlot.cs 2007-01-24 23:14:35 UTC (rev 25) @@ -152,13 +152,13 @@ } // do horizontal clipping here, to speed up - if ((dx1 < leftCutoff || rightCutoff < dx1) && - (dx2 < leftCutoff || rightCutoff < dx2)) + if ((dx1 < leftCutoff && dx2 < leftCutoff) || + (rightCutoff < dx1 && rightCutoff < dx2)) { continue; } - // else draw line. + // else draw line. PointF p1 = t.Transform( data[i-1] ); PointF p2 = t.Transform( data[i] ); Modified: trunk/src/StepPlot.cs =================================================================== --- trunk/src/StepPlot.cs 2007-01-24 23:02:37 UTC (rev 24) +++ trunk/src/StepPlot.cs 2007-01-24 23:14:35 UTC (rev 25) @@ -121,9 +121,8 @@ PointF yPos3 = yAxis.WorldToPhysical( p3.Y, false ); // do horizontal clipping here, to speed up - if ((p1.X < leftCutoff || p1.X > rightCutoff ) && - (p2.X < leftCutoff || p2.X > rightCutoff ) && - (p3.X < leftCutoff || p3.X > rightCutoff ) ) + if ((p1.X < leftCutoff && p2.X < leftCutoff && p3.X < leftCutoff) || + (p1.X > rightCutoff && p2.X > rightCutoff && p3.X > rightCutoff)) { continue; } @@ -150,7 +149,7 @@ } - } + } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |