rc->ToX = From.x;
rc->ToY = From.y;
rc->YDirection = -1;
+
+ // lines that go up get walked backwards, so need to be offset
+ // by -1 in order to make the walk identically on a pixel-level
+ rc->Error = -1;
}
else
{
rc->ToX = To.x;
rc->ToY = To.y;
rc->YDirection = 1;
+
+ rc->Error = 0;
}
rc->x = rc->FromX;
rc->ErrorMax = MAX(rc->absdx,rc->absdy);
- rc->Error = rc->ErrorMax / 2;
+ rc->Error += rc->ErrorMax / 2;
rc->XDirection = (rc->dx < 0)?(-1):(1);
while ( NULL != pRight )
{
- int x1 = pLeft->XIntercept[1];
- int x2 = pRight->XIntercept[0]+1;
+ int x1 = pLeft->XIntercept[1]+1;
+ int x2 = pRight->XIntercept[0];
if ( x2 > x1 )
{
RECTL BoundRect;
while ( NULL != pRight )
{
- int x1 = pLeft->XIntercept[1];
- int x2 = pRight->XIntercept[0]+1;
+ int x1 = pLeft->XIntercept[1]+1;
+ int x2 = pRight->XIntercept[0];
if ( winding && x2 > x1 )
{
RECTL BoundRect;
const int pts_count = sizeof(pts)/sizeof(pts[0]);
// use ALTERNATE or WINDING for 3rd param
- Polygon ( pts, pts_count, ALTERNATE );
+ Polygon ( pts, pts_count, WINDING );
// print out our "screen"
for ( int y = 0; y < SCREENY; y++ )
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: polyfill.c,v 1.9 2003/08/16 05:12:37 royce Exp $
+/* $Id: polyfill.c,v 1.10 2003/08/16 21:17:20 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
rc->ToX = From.x;
rc->ToY = From.y;
rc->YDirection = -1;
+
+ // lines that go up get walked backwards, so need to be offset
+ // by -1 in order to make the walk identically on a pixel-level
+ rc->Error = -1;
}
else
{
rc->ToX = To.x;
rc->ToY = To.y;
rc->YDirection = 1;
+
+ rc->Error = 0;
}
rc->x = rc->FromX;
rc->ErrorMax = MAX(rc->absdx,rc->absdy);
- rc->Error = rc->ErrorMax / 2;
+ rc->Error += rc->ErrorMax / 2;
rc->XDirection = (rc->dx < 0)?(-1):(1);
while ( NULL != pRight )
{
- int x1 = pLeft->XIntercept[1];
- int x2 = pRight->XIntercept[0]+1;
+ int x1 = pLeft->XIntercept[1]+1;
+ int x2 = pRight->XIntercept[0];
if ( x2 > x1 )
{
RECTL BoundRect;
while ( NULL != pRight )
{
- int x1 = pLeft->XIntercept[1];
- int x2 = pRight->XIntercept[0]+1;
+ int x1 = pLeft->XIntercept[1]+1;
+ int x2 = pRight->XIntercept[0];
if ( winding && x2 > x1 )
{
RECTL BoundRect;