mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 02:19:31 +02:00
IDE: designer: simplified TSelectedControl.SetBounds
git-svn-id: trunk@48741 -
This commit is contained in:
parent
ccee3d6654
commit
05d3490005
@ -627,12 +627,12 @@ end;
|
|||||||
|
|
||||||
procedure TSelectedControl.SetBounds(ALeft, ATop, AWidth, AHeight: integer);
|
procedure TSelectedControl.SetBounds(ALeft, ATop, AWidth, AHeight: integer);
|
||||||
begin
|
begin
|
||||||
|
FCachedLeft:=ALeft;
|
||||||
|
FCachedTop:=ATop;
|
||||||
|
FCachedWidth:=AWidth;
|
||||||
|
FCachedHeight:=AHeight;
|
||||||
if FIsTControl then begin
|
if FIsTControl then begin
|
||||||
TControl(FPersistent).SetBounds(ALeft, ATop, AWidth, AHeight);
|
TControl(FPersistent).SetBounds(ALeft, ATop, AWidth, AHeight);
|
||||||
FCachedLeft:=ALeft;
|
|
||||||
FCachedTop:=ATop;
|
|
||||||
FCachedWidth:=AWidth;
|
|
||||||
FCachedHeight:=AHeight;
|
|
||||||
end else if FIsNonVisualComponent then begin
|
end else if FIsNonVisualComponent then begin
|
||||||
if (Left<>ALeft) or (Top<>ATop) then begin
|
if (Left<>ALeft) or (Top<>ATop) then begin
|
||||||
//debugln(['TSelectedControl.SetBounds Old=',Left,',',Top,' New=',ALeft,',',ATop]);
|
//debugln(['TSelectedControl.SetBounds Old=',Left,',',Top,' New=',ALeft,',',ATop]);
|
||||||
@ -643,10 +643,6 @@ begin
|
|||||||
//debugln(['TSelectedControl.SetBounds Now=',Left,',',Top,' Expected=',ALeft,',',ATop]);
|
//debugln(['TSelectedControl.SetBounds Now=',Left,',',Top,' Expected=',ALeft,',',ATop]);
|
||||||
end;
|
end;
|
||||||
end else if (Owner.Mediator<>nil) and FIsTComponent then begin
|
end else if (Owner.Mediator<>nil) and FIsTComponent then begin
|
||||||
FCachedLeft:=ALeft;
|
|
||||||
FCachedTop:=ATop;
|
|
||||||
FCachedWidth:=AWidth;
|
|
||||||
FCachedHeight:=AHeight;
|
|
||||||
Owner.Mediator.SetBounds(TComponent(FPersistent),Bounds(ALeft,ATop,AWidth,AHeight));
|
Owner.Mediator.SetBounds(TComponent(FPersistent),Bounds(ALeft,ATop,AWidth,AHeight));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1347,6 +1343,7 @@ begin
|
|||||||
and (not ComponentBoundsDesignable(TComponent(Item.Persistent))) then
|
and (not ComponentBoundsDesignable(TComponent(Item.Persistent))) then
|
||||||
continue;
|
continue;
|
||||||
OldLeftTop:=Items[i].OldFormRelativeLeftTop;
|
OldLeftTop:=Items[i].OldFormRelativeLeftTop;
|
||||||
|
//if i=0 then debugln(['TControlSelection.DoApplyUserBounds OldLeftTop=',dbgs(OldLeftTop),' FWidth=',FWidth,' FHeight=',FHeight]);
|
||||||
NewLeft:=FLeft + round((single(OldLeftTop.X-FOldLeft) * single(FWidth))/single(FOldWidth));
|
NewLeft:=FLeft + round((single(OldLeftTop.X-FOldLeft) * single(FWidth))/single(FOldWidth));
|
||||||
NewTop:=FTop + round((single(OldLeftTop.Y-FOldTop) * single(FHeight))/single(FOldHeight));
|
NewTop:=FTop + round((single(OldLeftTop.Y-FOldTop) * single(FHeight))/single(FOldHeight));
|
||||||
NewWidth:=round(single(Item.OldWidth*FWidth)/single(FOldWidth));
|
NewWidth:=round(single(Item.OldWidth*FWidth)/single(FOldWidth));
|
||||||
|
Loading…
Reference in New Issue
Block a user