Changeset 523 for trunk/Packages/DpiControls
- Timestamp:
- Jan 7, 2024, 11:23:36 PM (11 months ago)
- Location:
- trunk/Packages/DpiControls
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/DpiControls/Dpi.Common.pas
r522 r523 89 89 uFlags: UINT): Boolean; 90 90 begin 91 LCLIntf.SetWindowPos(hWnd, hWndInsertAfter, ScaleToNative(X), ScaleToNative(Y),91 Result := LCLIntf.SetWindowPos(hWnd, hWndInsertAfter, ScaleToNative(X), ScaleToNative(Y), 92 92 ScaleToNative(cx), ScaleToNative(cy), uFlags); 93 93 end; … … 105 105 function ScaleFromNative(Value: Integer): Integer; 106 106 begin 107 Result := Round(Value * 96 / ScreenInfo.Dpi);107 Result := Floor(Value * 96 / ScreenInfo.Dpi); 108 108 end; 109 109 -
trunk/Packages/DpiControls/Dpi.Controls.pas
r482 r523 1028 1028 1029 1029 procedure TControl.NativeFormResize(Sender: TObject); 1030 begin 1031 BoundsRect := ScaleRectFromNative(GetNativeControl.BoundsRect); 1030 var 1031 R: TRect; 1032 begin 1033 R := ScaleRectFromNative(GetNativeControl.BoundsRect); 1034 FLeft := R.Left; 1035 FTop := R.Top; 1036 FWidth := R.Width; 1037 FHeight := R.Height; 1032 1038 DoFormResize; 1033 1039 end; … … 1070 1076 1071 1077 procedure TControl.UpdateBounds; 1072 var1073 R: TRect;1074 1078 begin 1075 1079 GetNativeControl.BoundsRect := ScaleRectToNative(BoundsRect); 1076 R := ScaleRectToNative(BoundsRect);1077 //WriteLog(Name + ' ' + IntToStr(R.Left) + ', ' + IntToStr(R.Top) + ', ' + IntToStr(R.Width) + ', ' + IntToStr(R.Height))1078 1080 end; 1079 1081
Note:
See TracChangeset
for help on using the changeset viewer.