--- mstools/samples/gdidemo/poly.c 2018/08/09 18:20:01 1.1.1.1 +++ mstools/samples/gdidemo/poly.c 2018/08/09 18:21:45 1.1.1.2 @@ -248,7 +248,7 @@ VOID PolyInitPoints(HWND hWnd) { GetClientRect(hWnd,&rect); - for(idx=0; idx < 4; idx++) + for(idx=0; idx < BEZ_PTS-1; idx++) { lpBez->pPts[idx].x = lRandom() % rect.right; lpBez->pPts[idx].y = lRandom() % rect.bottom; @@ -303,7 +303,7 @@ VOID PolyRedraw(HWND hWnd) */ for(j=1; j < ppd->nBezTotal; j++) { - for(i=0; i < 4; i++) + for(i=0; i < BEZ_PTS; i++) { (lpBez+j)->pPts[i].x = -1; (lpBez+j)->pPts[i].y = 0; @@ -323,9 +323,9 @@ VOID PolyRedraw(HWND hWnd) ** Draw the first curve in the bezier array. */ #ifdef WIN32 - PolyBezier(hDC,lpBez->pPts,4); + PolyBezier(hDC,lpBez->pPts,BEZ_PTS); #else - Polyline(hDC,lpBez->pPts,4); + Polyline(hDC,lpBez->pPts,BEZ_PTS); #endif ReleaseDC(hWnd,hDC); } @@ -379,14 +379,14 @@ static COLORREF crColor[] = {0x000000FF, { hPen = SelectObject(hDC,GetStockObject(BLACK_PEN)); #ifdef WIN32 - PolyBezier(hDC,lpCurr->pPts,4); + PolyBezier(hDC,lpCurr->pPts,BEZ_PTS); #else - Polyline(hDC,lpCurr->pPts,4); + Polyline(hDC,lpCurr->pPts,BEZ_PTS); #endif SelectObject(hDC,hPen); } - for(idx=0; idx < 4; idx++) + for(idx=0; idx < BEZ_PTS; idx++) { x = lpPrev->pPts[idx].x; y = lpPrev->pPts[idx].y; @@ -419,13 +419,14 @@ static COLORREF crColor[] = {0x000000FF, lpCurr->pPts[idx].x = x; lpCurr->pPts[idx].y = y; + } hPen = SelectObject(hDC,CreatePen(PS_SOLID,1,crColor[ppd->nColor])); #ifdef WIN32 - PolyBezier(hDC,lpCurr->pPts,4); + PolyBezier(hDC,lpCurr->pPts,BEZ_PTS); #else - Polyline(hDC,lpCurr->pPts,4); + Polyline(hDC,lpCurr->pPts,BEZ_PTS); #endif DeleteObject(SelectObject(hDC,hPen));