Changeset 522 for trunk/Packages/DpiControls
- Timestamp:
- Jan 7, 2024, 10:24:51 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/DpiControls/Dpi.Common.pas
r520 r522 21 21 function ScrollDC(Canvas: TCanvas; dx: Longint; dy: Longint; const lprcScroll: TRect; 22 22 const lprcClip:TRect; hrgnUpdate: Handle; lprcUpdate: PRect): Boolean; overload; 23 function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; 24 X, Y, cx, cy: Integer; uFlags: UINT): Boolean; 23 25 function ScaleToNative(Value: Integer): Integer; 24 26 function ScaleToNativeDist(Base, Value: Integer): Integer; … … 84 86 end; 85 87 86 function Ceil(const X: Single): Integer; 87 begin 88 if X > High(Integer) then 89 Result := High(Integer) 90 else if X < Low(Integer) then 91 Result := Low(Integer) 92 else begin 93 Result := Trunc(X); 94 if (Result <> X) then begin 95 if (Result > 0) then Inc(Result) else Dec(Result); 96 end; 97 end; 88 function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; X, Y, cx, cy: Integer; 89 uFlags: UINT): Boolean; 90 begin 91 LCLIntf.SetWindowPos(hWnd, hWndInsertAfter, ScaleToNative(X), ScaleToNative(Y), 92 ScaleToNative(cx), ScaleToNative(cy), uFlags); 98 93 end; 99 94 … … 110 105 function ScaleFromNative(Value: Integer): Integer; 111 106 begin 112 Result := Floor(Value * 96 / ScreenInfo.Dpi);107 Result := Round(Value * 96 / ScreenInfo.Dpi); 113 108 end; 114 109
Note:
See TracChangeset
for help on using the changeset viewer.