cody: lvlgraph: fixed GetNodeAt with scrolling

git-svn-id: trunk@40381 -
This commit is contained in:
mattias 2013-02-24 09:04:02 +00:00
parent fd01c56742
commit f20e7dc4f9

View File

@ -1484,13 +1484,15 @@ var
Node: TLvlGraphNode; Node: TLvlGraphNode;
begin begin
Result:=nil; Result:=nil;
X+=ScrollLeft;
Y+=ScrollTop;
// check in reverse painting order // check in reverse painting order
for l:=Graph.LevelCount-1 downto 0 do begin for l:=Graph.LevelCount-1 downto 0 do begin
Level:=Graph.Levels[l]; Level:=Graph.Levels[l];
if (x<Level.DrawPosition) or (x>=Level.DrawPosition+NodeStyle.Width) then continue; if (X<Level.DrawPosition) or (X>=Level.DrawPosition+NodeStyle.Width) then continue;
for n:=Level.Count-1 downto 0 do begin for n:=Level.Count-1 downto 0 do begin
Node:=Level.Nodes[n]; Node:=Level.Nodes[n];
if (y<Node.DrawPosition) or (y>=Node.DrawPositionEnd) then continue; if (Y<Node.DrawPosition) or (Y>=Node.DrawPositionEnd) then continue;
exit(Node); exit(Node);
end; end;
end; end;