Improves LCL-CustomDrawn scrolling

git-svn-id: trunk@34526 -
This commit is contained in:
sekelsenmat 2011-12-31 12:24:07 +00:00
parent 9887d5131e
commit 3943362c0c
2 changed files with 4 additions and 2 deletions

View File

@ -176,7 +176,7 @@ begin
if AWindowHandle.IsScrolling then
begin
lOldScrollY := AWindowHandle.ScrollY;
AWindowHandle.ScrollY := AWindowHandle.LastMousePos.Y - lEventPos.Y;
AWindowHandle.ScrollY := AWindowHandle.LastMousePos.Y - lEventPos.Y + AWindowHandle.ScrollY;
AWindowHandle.SanityCheckScrollPos();
if AWindowHandle.ScrollY <> lOldScrollY then LCLIntf.InvalidateRect(HWND(AWindowHandle), nil, False);
end;

View File

@ -513,7 +513,9 @@ begin
struct.hdc := HDC(ACanvas);
// Consider the form scrolling
ACanvas.BaseWindowOrg := Point(0, - lWindowHandle.ScrollY);
// ToDo: Figure out why this "div 2" factor is necessary for drawing non-windows controls and remove this factor
ACanvas.BaseWindowOrg := Point(0, - lWindowHandle.ScrollY div 2);
ACanvas.WindowOrg := Point(0, 0);
// Send the paint message to the LCL
{$IFDEF VerboseCDForms}