Commit c4eba5ff authored by ondrej's avatar ondrej
Browse files

IDE: designer: High-DPI: selection grabber. Issue #32397

git-svn-id: trunk@56001 -
parent f0349db7
......@@ -372,6 +372,7 @@ type
function GetBottomGuideLine(var ALine: TRect): boolean;
function GetLeftGuideLine(var ALine: TRect): boolean;
function GetRightGuideLine(var ALine: TRect): boolean;
function GetRealGrabberSize: integer;
function GetTopGuideLine(var ALine: TRect): boolean;
procedure FindNearestBottomGuideLine(var NearestInt: TNearestInt);
procedure FindNearestClientLeftRight(var NearestInt: TNearestInt);
......@@ -1232,23 +1233,23 @@ procedure TControlSelection.AdjustGrabbers;
var g:TGrabIndex;
OutPix, InPix, NewGrabberLeft, NewGrabberTop: integer;
begin
OutPix:=GrabberSize div 2;
InPix:=GrabberSize-OutPix;
OutPix:=GetRealGrabberSize div 2;
InPix:=GetRealGrabberSize-OutPix;
for g:=Low(TGrabIndex) to High(TGrabIndex) do begin
if gpLeft in FGrabbers[g].Positions then
NewGrabberLeft:=FRealLeft-OutPix
else if gpRight in FGrabbers[g].Positions then
NewGrabberLeft:=FRealLeft+FRealWidth-InPix
else
NewGrabberLeft:=FRealLeft+((FRealWidth-GrabberSize) div 2);
NewGrabberLeft:=FRealLeft+((FRealWidth-GetRealGrabberSize) div 2);
if gpTop in FGrabbers[g].Positions then
NewGrabberTop:=FRealTop-OutPix
else if gpBottom in FGrabbers[g].Positions then
NewGrabberTop:=FRealTop+FRealHeight-InPix
else
NewGrabberTop:=FRealTop+((FRealHeight-GrabberSize) div 2);
FGrabbers[g].Width:=GrabberSize;
FGrabbers[g].Height:=GrabberSize;
NewGrabberTop:=FRealTop+((FRealHeight-GetRealGrabberSize) div 2);
FGrabbers[g].Width:=GetRealGrabberSize;
FGrabbers[g].Height:=GetRealGrabberSize;
FGrabbers[g].Move(NewGrabberLeft,NewGrabberTop);
end;
end;
......@@ -2160,6 +2161,13 @@ begin
Result := DesignerProcs.GetParentFormRelativeBounds(AComponent);
end;
function TControlSelection.GetRealGrabberSize: integer;
begin
Result := FGrabberSize;
if Assigned(FForm) and Application.Scaled then
Result := FForm.Scale96ToScreen(FGrabberSize);
end;
function TControlSelection.GetItems(Index:integer):TSelectedControl;
begin
Result:=TSelectedControl(FControls[Index]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment