Browse Source

* fix #40242 by inverting some more x and y loops

(cherry picked from commit 322e8ca7e3af32b2aa8bc730e9ebd6e0c2dfa2ef)
marcoonthegit 2 years ago
parent
commit
40906ec49d
1 changed files with 6 additions and 6 deletions
  1. 6 6
      packages/fcl-image/src/pixtools.pp

+ 6 - 6
packages/fcl-image/src/pixtools.pp

@@ -73,9 +73,9 @@ begin
   SortRect (x1,y1, x2,y2);
   SortRect (x1,y1, x2,y2);
   with Canv do
   with Canv do
     begin
     begin
-    for x := x1 to x2 do
       for y := y1 to y2 do
       for y := y1 to y2 do
-        DrawPixel(x,y,color);
+        for x := x1 to x2 do
+          DrawPixel(x,y,color);
     end;
     end;
 end;
 end;
 
 
@@ -555,8 +555,8 @@ procedure FillRectangleImage (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer; const
 var x,y : integer;
 var x,y : integer;
 begin
 begin
   with image do
   with image do
-    for x := x1 to x2 do
-      for y := y1 to y2 do
+    for y := y1 to y2 do
+      for x := x1 to x2 do
         Canv.DrawPixel(x,y, colors[x mod width, y mod height]);
         Canv.DrawPixel(x,y, colors[x mod width, y mod height]);
 end;
 end;
 
 
@@ -564,8 +564,8 @@ procedure FillRectangleImageRel (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer; con
 var x,y : integer;
 var x,y : integer;
 begin
 begin
   with image do
   with image do
-    for x := x1 to x2 do
-      for y := y1 to y2 do
+    for y := y1 to y2 do
+      for x := x1 to x2 do
         Canv.DrawPixel(x,y, colors[(x-x1) mod width, (y-y1) mod height]);
         Canv.DrawPixel(x,y, colors[(x-x1) mod width, (y-y1) mod height]);
 end;
 end;