Misc: Switch x and y loops at several places. Issue #40231

This commit is contained in:
wp_xyz 2023-04-29 16:38:00 +02:00
parent 7c60b62155
commit 77ae9452b9
9 changed files with 24 additions and 23 deletions

View File

@ -1868,8 +1868,8 @@ begin
begin
if (lImageWidth*lImageHeight)*4 > Length(lImageData) then
raise Exception.Create(Format('[TvEPSVectorialReader.ExecutePaintingOperator] operator image: image data too small. Expected=%d Found=%d', [Length(lImageData), (lImageWidth*lImageHeight)*4]));
for x := 0 to lImageWidth - 1 do
for y := 0 to lImageHeight - 1 do
for y := 0 to lImageHeight - 1 do
for x := 0 to lImageWidth - 1 do
begin
lColorC := lImageData[(x+y*lImageWidth)*4] / $FF;
lColorM := lImageData[(x+y*lImageWidth)*4+1] / $FF;
@ -1886,8 +1886,8 @@ begin
begin
if (lImageWidth*lImageHeight)*3 > Length(lImageData) then
raise Exception.Create(Format('[TvEPSVectorialReader.ExecutePaintingOperator] operator image: image data too small. Expected=%d Found=%d', [Length(lImageData), (lImageWidth*lImageHeight)*3]));
for x := 0 to lImageWidth - 1 do
for y := 0 to lImageHeight - 1 do
for y := 0 to lImageHeight - 1 do
for x := 0 to lImageWidth - 1 do
begin
lColor.Alpha := alphaOpaque;
lColor.Red := lImageData[(x+y*lImageWidth)*3] * $101;

View File

@ -329,8 +329,8 @@ begin
lFile := TFileStream.Create('Terrain.raw', fmCreate);
try
for x := 0 to 1023 do
for y := 0 to 1023 do
for y := 0 to 1023 do
for x := 0 to 1023 do
begin
lRed := lRasterImage.RasterImage.Colors[x, y].Red;
lFile.WriteByte(Byte(lRed div $FF));

View File

@ -57,8 +57,8 @@ begin
AImage.SetRawImage(lRawImage);
for x := 0 to RAW_IMAGE_WIDTH - 1 do
for y := 0 to RAW_IMAGE_HEIGHT - 1 do
for y := 0 to RAW_IMAGE_HEIGHT - 1 do
for x := 0 to RAW_IMAGE_WIDTH - 1 do
begin
lColor.Red := AStream.ReadByte() * $FF;
AImage.Colors[x, y] := lColor;

View File

@ -500,8 +500,8 @@ begin
begin
TmpImage.Canvas.BrushCopy(IRect, FOriginal, ORect, FTransparentColor);
with TmpImage do
for X := 0 to Width - 1 do
for Y := 0 to Height - 1 do
for Y := 0 to Height - 1 do
for X := 0 to Width - 1 do
Canvas.Pixels[X, Y] := MapColor(Canvas.Pixels[X, Y]);
FIndexs[State] := FGlyphList.AddMasked(TmpImage, TColor(ColorToRGB(clBtnFace)));
end;

View File

@ -662,8 +662,8 @@ begin
if UseTransparentCopy then begin
if Images[FCurrentFrame].Bitmap <> nil then
for x := 0 to Images[FCurrentFrame].Bitmap.Width - 1 do
for y := 0 to Images[FCurrentFrame].Bitmap.Height - 1 do
for y := 0 to Images[FCurrentFrame].Bitmap.Height - 1 do
for x := 0 to Images[FCurrentFrame].Bitmap.Width - 1 do
if Images[FCurrentFrame].Bitmap.Canvas.Pixels[x, y] <>
Images[FCurrentFrame].TransparentColor then begin
if (x + Images[FCurrentFrame].XOffset < Bitmap.Width) and

View File

@ -105,11 +105,12 @@ begin
FBitmap.Canvas.Brush.Style := bsSolid;
FBitmap.Canvas.Brush.Color := colorBG;
FBitmap.Canvas.Rectangle(0,0,7,7);
for x := 0 to 7 do for y := 0 to 7 do
begin
if ((not Odd(x)) and (not Odd(y))) xor ((Odd(x)) and (Odd(y))) then
FBitmap.Canvas.Pixels[x,y] := colorFG;
end;
for y := 0 to 7 do
for x := 0 to 7 do
begin
if ((not Odd(x)) and (not Odd(y))) xor ((Odd(x)) and (Odd(y))) then
FBitmap.Canvas.Pixels[x,y] := colorFG;
end;
end;
destructor TPatternBitmap.Destroy;

View File

@ -300,8 +300,8 @@ begin
W := (R.Right - R.Left - 1) div DX;
H := (R.Bottom - R.Top - 1) div DY;
for X := 0 to W do
for Y := 0 to H do
for Y := 0 to H do
for X := 0 to W do
QtDC.drawPoint(R.Left + X * DX, R.Top + Y * DY + 1);
finally
QtDC.restore;

View File

@ -298,8 +298,8 @@ begin
W := (R.Right - R.Left - 1) div DX;
H := (R.Bottom - R.Top - 1) div DY;
for X := 0 to W do
for Y := 0 to H do
for Y := 0 to H do
for X := 0 to W do
QtDC.drawPoint(R.Left + X * DX, R.Top + Y * DY + 1);
finally
QtDC.restore;

View File

@ -298,8 +298,8 @@ begin
W := (R.Right - R.Left - 1) div DX;
H := (R.Bottom - R.Top - 1) div DY;
for X := 0 to W do
for Y := 0 to H do
for Y := 0 to H do
for X := 0 to W do
QtDC.drawPoint(R.Left + X * DX, R.Top + Y * DY + 1);
finally
QtDC.restore;