mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 06:00:07 +02:00
carbon: fix bitmap's floodfilling
git-svn-id: trunk@26378 -
This commit is contained in:
parent
97ea2bc6df
commit
6bf1f4bb96
@ -2547,7 +2547,6 @@ begin
|
|||||||
try
|
try
|
||||||
GetRGBA(Bitmap, x,y, sr, sg, sb, sa, clpos);
|
GetRGBA(Bitmap, x,y, sr, sg, sb, sa, clpos);
|
||||||
if (sr=r) and (sg=g) and (sb=b) then Exit;
|
if (sr=r) and (sg=g) and (sb=b) then Exit;
|
||||||
|
|
||||||
SetLength(data, Bitmap.Width*Bitmap.Height);
|
SetLength(data, Bitmap.Width*Bitmap.Height);
|
||||||
cnt:=1;
|
cnt:=1;
|
||||||
data[0].x:=x;
|
data[0].x:=x;
|
||||||
@ -2562,16 +2561,14 @@ begin
|
|||||||
begin
|
begin
|
||||||
i:=x+dx[k];
|
i:=x+dx[k];
|
||||||
j:=y+dy[k];
|
j:=y+dy[k];
|
||||||
for j:=Max(0, y-1) to Min(Bitmap.Height-1, y+1) do
|
if (i<0) or (j<0) or (i>=Bitmap.Width) or (j>=Bitmap.Height) then Continue;
|
||||||
|
GetRGBA(Bitmap, i,j, tr, tg, tb, ta, clPos);
|
||||||
|
if (tr=sr) and (tg=sg) and (tb=sb) then
|
||||||
begin
|
begin
|
||||||
GetRGBA(Bitmap, i,j, tr, tg, tb, ta, clPos);
|
SetRGBA(Bitmap, i,j, r, g, b, a, clPos);
|
||||||
if (tr=sr) and (tg=sg) and (tb=sb) then
|
data[cnt].X:=i;
|
||||||
begin
|
data[cnt].Y:=j;
|
||||||
SetRGBA(Bitmap, i,j, r, g, b, a, clPos);
|
inc(cnt);
|
||||||
data[cnt].X:=i;
|
|
||||||
data[cnt].Y:=j;
|
|
||||||
inc(cnt);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
dec(cnt);
|
dec(cnt);
|
||||||
|
Loading…
Reference in New Issue
Block a user