mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 08:50:16 +02:00
LCL: grids: fix clipping area for scrolling.
git-svn-id: trunk@52323 -
This commit is contained in:
parent
d142d5f737
commit
cb66fc3d5c
@ -3254,25 +3254,24 @@ end;
|
||||
|
||||
procedure TCustomGrid.ScrollBy(DeltaX, DeltaY: Integer);
|
||||
var
|
||||
ScrollArea, ClipArea: TRect;
|
||||
ClipArea: TRect;
|
||||
ScrollFlags: Integer;
|
||||
begin
|
||||
if (DeltaX=0) and (DeltaY=0) then
|
||||
Exit;
|
||||
|
||||
ScrollFlags := SW_INVALIDATE or SW_ERASE;
|
||||
ScrollArea := ClientRect;
|
||||
if DeltaX<>0 then
|
||||
begin
|
||||
ClipArea := ClientRect;
|
||||
Inc(ClipArea.Left, FGCache.FixedWidth);
|
||||
ScrollWindowEx(Handle, DeltaX, 0, @ScrollArea, @ClipArea, 0, nil, ScrollFlags);
|
||||
ScrollWindowEx(Handle, DeltaX, 0, @ClipArea, @ClipArea, 0, nil, ScrollFlags);
|
||||
end;
|
||||
if DeltaY<>0 then
|
||||
begin
|
||||
ClipArea := ClientRect;
|
||||
Inc(ClipArea.Top, FGCache.FixedHeight);
|
||||
ScrollWindowEx(Handle, 0, DeltaY, @ScrollArea, @ClipArea, 0, nil, ScrollFlags);
|
||||
ScrollWindowEx(Handle, 0, DeltaY, @ClipArea, @ClipArea, 0, nil, ScrollFlags);
|
||||
end;
|
||||
|
||||
CacheVisibleGrid;
|
||||
|
Loading…
Reference in New Issue
Block a user