move PatternX initiate calculation out from for loop, it should have been outside of the for loop.
Modified: trunk/reactos/tools/gendib/gendib.c

Modified: trunk/reactos/tools/gendib/gendib.c
--- trunk/reactos/tools/gendib/gendib.c	2005-07-07 17:09:56 UTC (rev 16489)
+++ trunk/reactos/tools/gendib/gendib.c	2005-07-07 17:54:50 UTC (rev 16490)
@@ -481,6 +481,12 @@
       Output(Out, "CenterCount = 2 * (BltInfo->DestRect.right -\n");
       Output(Out, "                   BltInfo->DestRect.left);\n");
     }
+  if (RopInfo->UsesPattern && 0 != (Flags & FLAG_PATTERNSURFACE))
+    {
+      Output(Out, "PatternX = (BltInfo->DestRect.left + BltInfo->BrushOrigin.x) %%\n");
+      Output(Out, "           BltInfo->PatternSurface->sizlBitmap.cx;\n");
+    }
+
   Output(Out, "for (LineIndex = 0; LineIndex < LineCount; LineIndex++)\n");
   Output(Out, "{\n");
   if (ROPCODE_SRCCOPY != RopInfo->RopCode ||
@@ -497,11 +503,7 @@
         }
       Output(Out, "DestPtr = (PULONG) DestBase;\n");
     }
-  if (RopInfo->UsesPattern && 0 != (Flags & FLAG_PATTERNSURFACE))
-    {
-      Output(Out, "PatternX = (BltInfo->DestRect.left + BltInfo->BrushOrigin.x) %%\n");
-      Output(Out, "           BltInfo->PatternSurface->sizlBitmap.cx;\n");
-    }
+  
   if (ROPCODE_SRCCOPY == RopInfo->RopCode &&
       0 != (Flags & FLAG_TRIVIALXLATE) && Bpp == SourceBpp)
     {