LCL: grids: fix clipping area for scrolling.

git-svn-id: trunk@52323 -
This commit is contained in:
ondrej 2016-05-17 21:06:32 +00:00
parent d142d5f737
commit cb66fc3d5c

View File

@ -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;