mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-29 18:03:54 +02:00
LCL: SetAlign: restore the basebounds set before changes
git-svn-id: trunk@36870 -
This commit is contained in:
parent
73fef58a27
commit
eb05b8141f
@ -3976,9 +3976,8 @@ begin
|
||||
begin
|
||||
// in case asrCenter, both sides are controlled by one anchor
|
||||
// -> disable opposite anchor and aligning
|
||||
if FOwner.Align in [alLeft,alTop,alRight,alBottom,alClient] then begin
|
||||
if not (FOwner.Align in [alNone,alCustom]) then
|
||||
FOwner.Align:=alNone;
|
||||
end;
|
||||
FOwner.Anchors:=FOwner.Anchors-[OppositeAnchor[Kind]];
|
||||
end;
|
||||
end;
|
||||
|
@ -3707,10 +3707,12 @@ procedure TControl.SetAlign(Value: TAlign);
|
||||
var
|
||||
OldAlign: TAlign;
|
||||
a: TAnchorKind;
|
||||
OldBaseBounds: TRect;
|
||||
begin
|
||||
if FAlign = Value then exit;
|
||||
//DebugLn(['TControl.SetAlign ',DbgSName(Self),' Old=',DbgS(FAlign),' New=',DbgS(Value),' ',Anchors<>AnchorAlign[FAlign]]);
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.setalign'){$ENDIF};
|
||||
OldBaseBounds:=BaseBounds;
|
||||
OldAlign := FAlign;
|
||||
FAlign := Value;
|
||||
if (not (csLoading in ComponentState))
|
||||
@ -3731,7 +3733,7 @@ begin
|
||||
if (Anchors = AnchorAlign[OldAlign]) and (Anchors <> AnchorAlign[FAlign]) then
|
||||
Anchors := AnchorAlign[FAlign];
|
||||
if not (csLoading in ComponentState) then
|
||||
BoundsRect:=BaseBounds;
|
||||
BoundsRect:=OldBaseBounds;
|
||||
//DebugLn(['TControl.SetAlign ',DbgSName(Self),' Cur=',DbgS(FAlign),' New=',DbgS(Value),' ',Anchors<>AnchorAlign[FAlign],' Anchors=',dbgs(Anchors)]);
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.setalign'){$ENDIF};
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user