Laz.VirtualTree: improve paint speed

This commit is contained in:
Martin 2024-08-18 17:03:13 +02:00
parent ee92dc809b
commit 4180135581

View File

@ -30850,7 +30850,11 @@ begin
// Adjust height of temporary node bitmap.
with NodeBitmap do
begin
{$ifdef LCLCocoa}
if Height <> PaintInfo.Node.NodeHeight then
{$else}
if Height < PaintInfo.Node.NodeHeight then
{$endif}
begin
// Avoid that the VCL copies the bitmap while changing its height.
{$ifdef LCLCocoa}
@ -30862,7 +30866,8 @@ begin
cglast := cg;
end;
{$else}
Height := PaintInfo.Node.NodeHeight;
if Height > 0 then SetSize(1,1); // can't go to 0, must keep canvas
SetSize(PaintWidth, PaintInfo.Node.NodeHeight);
{$endif}
{$ifdef UseSetCanvasOrigin}
SetCanvasOrigin(Canvas, Window.Left, 0);
@ -31200,7 +31205,7 @@ begin
);
{$else}
BitBlt(TargetCanvas.Handle, Left,
Top {$ifdef ManualClipNeeded} + YCorrect{$endif}, Width, Height, Canvas.Handle, Window.Left,
Top {$ifdef ManualClipNeeded} + YCorrect{$endif}, Width, PaintInfo.Node.NodeHeight, Canvas.Handle, Window.Left,
{$ifdef ManualClipNeeded}YCorrect{$else}0{$endif}, SRCCOPY);
{$endif}
end;