You've already forked lazarus-ccr
* Fix drawing trees with more nodes than 2000 nodes (CacheThreshold) by moving the header offset adjust from GetNodeAt to GetHitTestInfo
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@406 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -24371,6 +24371,14 @@ begin
|
|||||||
if X > Header.Columns.GetVisibleFixedWidth then
|
if X > Header.Columns.GetVisibleFixedWidth then
|
||||||
Inc(X, FEffectiveOffsetX);
|
Inc(X, FEffectiveOffsetX);
|
||||||
Inc(Y, -FOffsetY);
|
Inc(Y, -FOffsetY);
|
||||||
|
//lclheder
|
||||||
|
if hoVisible in FHeader.Options then
|
||||||
|
begin
|
||||||
|
Dec(Y, FHeader.Height);
|
||||||
|
//the coordinate is in header
|
||||||
|
if Y < 0 then
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// If the point is in the tree area then check the nodes.
|
// If the point is in the tree area then check the nodes.
|
||||||
@ -25146,7 +25154,7 @@ end;
|
|||||||
function TBaseVirtualTree.GetNodeAt(X, Y: Integer; Relative: Boolean; var NodeTop: Integer): PVirtualNode;
|
function TBaseVirtualTree.GetNodeAt(X, Y: Integer; Relative: Boolean; var NodeTop: Integer): PVirtualNode;
|
||||||
|
|
||||||
// This method returns the node that occupies the specified point, or nil if there's none.
|
// This method returns the node that occupies the specified point, or nil if there's none.
|
||||||
// If Releative is True then X and Y are given in client coordinates otherwise they are considered as being
|
// If Relative is True then X and Y are given in client coordinates otherwise they are considered as being
|
||||||
// absolute values into the virtual tree image (regardless of the current offsets in the tree window).
|
// absolute values into the virtual tree image (regardless of the current offsets in the tree window).
|
||||||
// NodeTop gets the absolute or relative top position of the node returned or is untouched if no node
|
// NodeTop gets the absolute or relative top position of the node returned or is untouched if no node
|
||||||
// could be found.
|
// could be found.
|
||||||
@ -25161,22 +25169,13 @@ begin
|
|||||||
|
|
||||||
AbsolutePos := Y;
|
AbsolutePos := Y;
|
||||||
if Relative then
|
if Relative then
|
||||||
begin
|
|
||||||
Inc(AbsolutePos, -FOffsetY);
|
Inc(AbsolutePos, -FOffsetY);
|
||||||
if hoVisible in FHeader.FOptions then
|
|
||||||
Inc(AbsolutePos, FHeader.Height);
|
|
||||||
end;
|
|
||||||
|
|
||||||
// CurrentPos tracks a running term of the current position to test for.
|
// CurrentPos tracks a running term of the current position to test for.
|
||||||
// It corresponds always to the top position of the currently considered node.
|
// It corresponds always to the top position of the currently considered node.
|
||||||
|
|
||||||
//lclheader: adjust position if Header is visible
|
CurrentPos := 0;
|
||||||
if hoVisible in FHeader.FOptions then
|
|
||||||
CurrentPos := FHeader.Height
|
|
||||||
else
|
|
||||||
CurrentPos := 0;
|
|
||||||
|
|
||||||
|
|
||||||
// If the cache is available then use it.
|
// If the cache is available then use it.
|
||||||
if tsUseCache in FStates then
|
if tsUseCache in FStates then
|
||||||
Result := FindInPositionCache(AbsolutePos, CurrentPos)
|
Result := FindInPositionCache(AbsolutePos, CurrentPos)
|
||||||
@ -25237,10 +25236,7 @@ begin
|
|||||||
// of the found node this top position is returned.
|
// of the found node this top position is returned.
|
||||||
if Assigned(Result) then
|
if Assigned(Result) then
|
||||||
begin
|
begin
|
||||||
//lclheader
|
|
||||||
NodeTop := CurrentPos;
|
NodeTop := CurrentPos;
|
||||||
if hoVisible in FHeader.FOptions then
|
|
||||||
Dec(NodeTop,FHeader.Height);
|
|
||||||
if Relative then
|
if Relative then
|
||||||
Inc(NodeTop, FOffsetY);
|
Inc(NodeTop, FOffsetY);
|
||||||
//Logger.Send([lcPaintHeader],'GetNodeAt Result: ',Result^.Index);
|
//Logger.Send([lcPaintHeader],'GetNodeAt Result: ',Result^.Index);
|
||||||
|
Reference in New Issue
Block a user