[ros-diffs] [tkreuzer] 30259: IntGdiPolygon: close the polygon outline See issue #2782 for more details.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Thu Nov 8 03:19:26 CET 2007


Author: tkreuzer
Date: Thu Nov  8 05:19:25 2007
New Revision: 30259

URL: http://svn.reactos.org/svn/reactos?rev=30259&view=rev
Log:
IntGdiPolygon: close the polygon outline
See issue #2782 for more details.

Modified:
    trunk/reactos/subsystems/win32/win32k/objects/fillshap.c

Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/fillshap.c?rev=30259&r1=30258&r2=30259&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/fillshap.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/fillshap.c Thu Nov  8 05:19:25 2007
@@ -104,9 +104,11 @@
         // Draw the Polygon Edges with the current pen ( if not a NULL pen )
         if (PenBrushObj && !(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
         {
+            int i;
+
             IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
 
-            while (Count-- >1)
+            for (i = 0; i < Count-1; i++)
             {
 
 // DPRINT1("Polygon Making line from (%d,%d) to (%d,%d)\n",
@@ -116,14 +118,26 @@
                 ret = IntEngLineTo(&BitmapObj->SurfObj,
                                    dc->CombinedClip,
                                    &PenBrushInst.BrushObject,
-                                   UnsafePoints[0].x,          /* From */
-                                   UnsafePoints[0].y,
-                                   UnsafePoints[1].x,          /* To */
-                                   UnsafePoints[1].y,
+                                   UnsafePoints[i].x,          /* From */
+                                   UnsafePoints[i].y,
+                                   UnsafePoints[i+1].x,          /* To */
+                                   UnsafePoints[i+1].y,
                                    &DestRect,
                                    ROP2_TO_MIX(dc->Dc_Attr.jROP2)); /* MIX */
                 if (!ret) break;
-                UnsafePoints++;
+            }
+            /* Close the polygon */
+            if (ret)
+            {
+                ret = IntEngLineTo(&BitmapObj->SurfObj,
+                                   dc->CombinedClip,
+                                   &PenBrushInst.BrushObject,
+                                   UnsafePoints[Count-1].x,          /* From */
+                                   UnsafePoints[Count-1].y,
+                                   UnsafePoints[0].x,          /* To */
+                                   UnsafePoints[0].y,
+                                   &DestRect,
+                                   ROP2_TO_MIX(dc->Dc_Attr.jROP2)); /* MIX */
             }
         }
         PENOBJ_UnlockPen(PenBrushObj);




More information about the Ros-diffs mailing list