* Search element from back to front to respect Z-order (bug id #33291)

git-svn-id: trunk@57683 -
This commit is contained in:
michael 2018-04-21 19:43:49 +00:00
parent 445127a35d
commit b31e9e78e1

View File

@ -913,8 +913,9 @@ begin
Result:=B; Result:=B;
RB:=B.AsBand; RB:=B.AsBand;
O:=Nil; O:=Nil;
I:=0; // We must search backwards
While (O=Nil) and (I<COunt) do I:=Count-1;
While (O=Nil) and (I>=0) do
begin begin
O:=Objects[i]; O:=Objects[i];
{$IFDEF DEBUGROL} {$IFDEF DEBUGROL}
@ -930,7 +931,7 @@ begin
if not PtInRect(R,P) then if not PtInRect(R,P) then
O:=Nil; O:=Nil;
end; end;
Inc(I); Dec(I);
end; end;
if O<>Nil then if O<>Nil then
Result:=O; Result:=O;