From 6c35289e98db8fb65e35e9de14e97561ce7d3e3a Mon Sep 17 00:00:00 2001 From: ondrej Date: Mon, 21 Aug 2017 20:00:14 +0000 Subject: [PATCH] IDE: high-DPI: scale created components git-svn-id: trunk@55734 - --- ide/customformeditor.pp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ide/customformeditor.pp b/ide/customformeditor.pp index 1c595740d7..60a348d77f 100644 --- a/ide/customformeditor.pp +++ b/ide/customformeditor.pp @@ -1337,8 +1337,18 @@ begin begin AControl := TControl(NewComponent); // calc bounds - if CompWidth <= 0 then CompWidth := Max(5, AControl.Width); - if CompHeight <= 0 then CompHeight := Max(5, AControl.Height); + if CompWidth <= 0 then + begin + CompWidth := Max(5, AControl.Width); + if AParent<>nil then + CompWidth := AParent.Scale96ToForm(CompWidth); + end; + if CompHeight <= 0 then + begin + CompHeight := Max(5, AControl.Height); + if AParent<>nil then + CompHeight := AParent.Scale96ToForm(CompHeight); + end; MonitorBounds := ActiveMonitor.BoundsRect; if (CompLeft < 0) and (AParent <> nil) then CompLeft := (AParent.Width - CompWidth) div 2