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