Update of /cvsroot/perl-win32-gui/Win32-GUI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1693

Modified Files:
        CHANGELOG DC.xs 
Log Message:
Fix all the Poly*() draw routines

Index: DC.xs
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/DC.xs,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** DC.xs       26 Jun 2006 18:22:52 -0000      1.15
--- DC.xs       15 Jul 2007 18:29:00 -0000      1.16
***************
*** 387,391 ****
  
      
###########################################################################
!     # (@)METHOD:Polygon([X,Y]+)
      # Draws a polygon consisting of two or more vertices connected by
      # straight lines.
--- 387,391 ----
  
      
###########################################################################
!     # (@)METHOD:Polygon(X1, Y1, X2, Y2, [ X, Y, ... ])
      # Draws a polygon consisting of two or more vertices connected by
      # straight lines.
***************
*** 395,409 ****
  PREINIT:
      POINT *lpPoints;
!     int nCount, i;
  CODE:
!     if (items < 5 || (items - 1) % 2 != 0)
!         croak("Usage: Polygon([x, y]+);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1; i < items; i += 2) {
!         lpPoints[i].x = SvIV(ST(i));
!         lpPoints[i].y = SvIV(ST(i+1));
      }
          
--- 395,409 ----
  PREINIT:
      POINT *lpPoints;
!     int nCount, i, j;
  CODE:
!     if (items < 5 || (items - 5) % 2 != 0)
!         croak("Usage: Polygon(X1, Y1, X2, Y2, [ X, Y, ... ]);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1, j = 0; i < items; i += 2, j++) {
!         lpPoints[j].x = SvIV(ST(i));
!         lpPoints[j].y = SvIV(ST(i+1));
      }
          
***************
*** 697,701 ****
  
      
###########################################################################
!     # (@)METHOD:PolyBezier([X,Y]+)
      # Draws one or more Bézier curves. 
      # The first curve is drawn from the first point to the fourth point by
--- 697,701 ----
  
      
###########################################################################
!     # (@)METHOD:PolyBezier(X1, Y1, X2, Y2, X3, Y3, X4, Y4, [ X, Y, ... ])
      # Draws one or more Bézier curves. 
      # The first curve is drawn from the first point to the fourth point by
***************
*** 710,724 ****
  PREINIT:
      POINT *lpPoints;
!     int nCount, i;
  CODE:
!     if (items < 9 || (items - 1) % 2 != 0)
!         croak("Usage: PolyBezier([x, y]+);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1; i < items; i += 2) {
!         lpPoints[i].x = SvIV(ST(i));
!         lpPoints[i].y = SvIV(ST(i+1));
      }
          
--- 710,724 ----
  PREINIT:
      POINT *lpPoints;
!     int nCount, i, j;
  CODE:
!     if (items < 9 || (items - 9) % 6 != 0)
!         croak("Usage: PolyBezier(X1, Y1, X2, Y2, X3, Y3, X4, Y4, [ X, Y, ... 
]);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1, j = 0; i < items; i += 2, j++) {
!         lpPoints[j].x = SvIV(ST(i));
!         lpPoints[j].y = SvIV(ST(i+1));
      }
          
***************
*** 729,733 ****
  
      
###########################################################################
!     # (@)METHOD:PolyBezierTo ([X,Y]+)
      # Draws cubic Bézier curves.
      # The first curve is drawn from the current position to the third point by
--- 729,733 ----
  
      
###########################################################################
!     # (@)METHOD:PolyBezierTo(X1, Y1, X2, Y2, X3, Y3, [ X, Y, ... ])
      # Draws cubic Bézier curves.
      # The first curve is drawn from the current position to the third point by
***************
*** 740,754 ****
  PREINIT:
      POINT *lpPoints;
!     int nCount, i;
  CODE:
!     if (items < 7 || (items - 1) % 2 != 0)
!         croak("Usage: PolyBezier([x, y]+);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1; i < items; i += 2) {
!         lpPoints[i].x = SvIV(ST(i));
!         lpPoints[i].y = SvIV(ST(i+1));
      }
          
--- 740,754 ----
  PREINIT:
      POINT *lpPoints;
!     int nCount, i, j;
  CODE:
!     if (items < 7 || (items - 7) % 6 != 0)
!         croak("Usage: PolyBezier(X1, Y1, X2, Y2, X3, Y3, [ X, Y, ... ]);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1, j = 0; i < items; i += 2, j++) {
!         lpPoints[j].x = SvIV(ST(i));
!         lpPoints[j].y = SvIV(ST(i+1));
      }
          
***************
*** 761,765 ****
  
      
###########################################################################
!     # (@)METHOD:Polyline ([X,Y]+)
      # Draws one or more straight lines.
  BOOL
--- 761,765 ----
  
      
###########################################################################
!     # (@)METHOD:Polyline (X1, Y1, X2, Y2, [ X, Y, ... ])
      # Draws one or more straight lines.
  BOOL
***************
*** 768,782 ****
  PREINIT:
      POINT *lpPoints;
!     int nCount, i;
  CODE:
!     if (items < 5 || (items - 1) % 2 != 0)
!         croak("Usage: PolyBezier([x, y]+);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1; i < items; i += 2) {
!         lpPoints[i].x = SvIV(ST(i));
!         lpPoints[i].y = SvIV(ST(i+1));
      }
          
--- 768,782 ----
  PREINIT:
      POINT *lpPoints;
!     int nCount, i, j;
  CODE:
!     if (items < 5 || (items - 5) % 2 != 0)
!         croak("Usage: Polyline(X1, Y1, X2, Y2, [ X, Y, ... ]);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1, j = 0; i < items; i += 2, j++) {
!         lpPoints[j].x = SvIV(ST(i));
!         lpPoints[j].y = SvIV(ST(i+1));
      }
          
***************
*** 787,791 ****
  
      
###########################################################################
!     # (@)METHOD:PolylineTo ([X,Y]+)
      # Draws one or more straight lines. 
  BOOL
--- 787,791 ----
  
      
###########################################################################
!     # (@)METHOD:PolylineTo (X1, Y1, [ X, Y, ... ])
      # Draws one or more straight lines. 
  BOOL
***************
*** 794,808 ****
  PREINIT:
      POINT *lpPoints;
!     int nCount, i;
  CODE:
!     if (items < 5 || (items - 1) % 2 != 0)
!         croak("Usage: PolyBezier([x, y]+);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1; i < items; i += 2) {
!         lpPoints[i].x = SvIV(ST(i));
!         lpPoints[i].y = SvIV(ST(i+1));
      }
          
--- 794,808 ----
  PREINIT:
      POINT *lpPoints;
!     int nCount, i, j;
  CODE:
!     if (items < 3 || (items - 3) % 2 != 0)
!         croak("Usage: PolylineTo(X1, Y2, [ X, Y, ... ]);\n");
      
      nCount   = (items - 1) / 2;
      lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));
  
!     for (i = 1, j = 0; i < items; i += 2, j++) {
!         lpPoints[j].x = SvIV(ST(i));
!         lpPoints[j].y = SvIV(ST(i+1));
      }
          

Index: CHANGELOG
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** CHANGELOG   15 Jul 2007 18:23:06 -0000      1.110
--- CHANGELOG   15 Jul 2007 18:29:00 -0000      1.111
***************
*** 11,14 ****
--- 11,16 ----
        -dropdownlist together have a more predictable result.
        Update docs. [Glenn Linderman]
+     - DC.xs - Fix Polygon(), PolyBezier(), PolyBezierTo(), PolyLine(),
+       PolyLineTo(). [George]
  
  + [Robert May] : 20 January 2007 - Restore Original WndProc


Reply via email to