mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 19:20:17 +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);
|
procedure TControlScrollBar.SetPosition(const Value: Integer);
|
||||||
var
|
var
|
||||||
MaxPos: Integer;
|
MaxPos, PrevPosition: Integer;
|
||||||
ScrollInfo: TScrollInfo;
|
ScrollInfo: TScrollInfo;
|
||||||
begin
|
begin
|
||||||
if csLoading in FControl.ComponentState then
|
if csLoading in FControl.ComponentState then
|
||||||
@ -70,14 +70,14 @@ begin
|
|||||||
if Value = FPosition then
|
if Value = FPosition then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
PrevPosition := FPosition;
|
||||||
|
// position has to be set before FControl.ScrollBy !!!
|
||||||
|
FPosition := Value;
|
||||||
// scroll logical client area of FControl
|
// scroll logical client area of FControl
|
||||||
if Kind = sbVertical then
|
if Kind = sbVertical then
|
||||||
FControl.ScrollBy(0, FPosition - Value)
|
FControl.ScrollBy(0, PrevPosition - FPosition)
|
||||||
else
|
else
|
||||||
FControl.ScrollBy(FPosition - Value, 0);
|
FControl.ScrollBy(PrevPosition - FPosition, 0);
|
||||||
|
|
||||||
// now actually set the position
|
|
||||||
FPosition := Value;
|
|
||||||
|
|
||||||
// check that the new position is also set on the scrollbar
|
// check that the new position is also set on the scrollbar
|
||||||
if HandleAllocated and (GetScrollPos(ControlHandle, IntfBarKind[Kind]) <> FPosition) then
|
if HandleAllocated and (GetScrollPos(ControlHandle, IntfBarKind[Kind]) <> FPosition) then
|
||||||
|
Loading…
Reference in New Issue
Block a user