mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 18:59:10 +02:00
LCL: fixed regression in scrolling from r50523 #6bb18f6fbd
git-svn-id: trunk@50557 -
This commit is contained in:
parent
0b0f12ffd5
commit
8fae307e89
@ -24,7 +24,7 @@ const
|
||||
|
||||
procedure TControlScrollBar.SetPosition(const Value: Integer);
|
||||
var
|
||||
MaxPos: Integer;
|
||||
MaxPos, PrevPosition: Integer;
|
||||
ScrollInfo: TScrollInfo;
|
||||
begin
|
||||
if csLoading in FControl.ComponentState then
|
||||
@ -70,14 +70,14 @@ begin
|
||||
if Value = FPosition then
|
||||
exit;
|
||||
|
||||
PrevPosition := FPosition;
|
||||
// position has to be set before FControl.ScrollBy !!!
|
||||
FPosition := Value;
|
||||
// scroll logical client area of FControl
|
||||
if Kind = sbVertical then
|
||||
FControl.ScrollBy(0, FPosition - Value)
|
||||
FControl.ScrollBy(0, PrevPosition - FPosition)
|
||||
else
|
||||
FControl.ScrollBy(FPosition - Value, 0);
|
||||
|
||||
// now actually set the position
|
||||
FPosition := Value;
|
||||
FControl.ScrollBy(PrevPosition - FPosition, 0);
|
||||
|
||||
// check that the new position is also set on the scrollbar
|
||||
if HandleAllocated and (GetScrollPos(ControlHandle, IntfBarKind[Kind]) <> FPosition) then
|
||||
|
Loading…
Reference in New Issue
Block a user