LCL: Minor improvement for scaling in Grids and ImageList. Issue #35648, patch from Alexey Tor.

git-svn-id: trunk@62090 -
This commit is contained in:
juha 2019-10-19 10:53:30 +00:00
parent 167df5e84a
commit 6e36102baf
2 changed files with 4 additions and 4 deletions

View File

@ -9803,9 +9803,9 @@ begin
FSpecialCursors[gcsRowHeightChanging] := crVSplit;
FSpecialCursors[gcsDragging] := crMultiDrag;
varRubberSpace := MulDiv(constRubberSpace, Screen.PixelsPerInch, 96);
varCellPadding := MulDiv(constCellPadding, Screen.PixelsPerInch, 96);
varColRowBorderTolerance := MulDiv(constColRowBorderTolerance, Screen.PixelsPerInch, 96);
varRubberSpace := Scale96ToScreen(constRubberSpace);
varCellPadding := Scale96ToScreen(constCellPadding);
varColRowBorderTolerance := Scale96ToScreen(constColRowBorderTolerance);
end;
destructor TCustomGrid.Destroy;

View File

@ -1880,7 +1880,7 @@ begin
if not FScaled then
Result := AImageWidth
else begin
Result := round(AImageWidth * APPI / 96);
Result := AImageWidth * APPI div 96;
if not FData.Find(Result, idx) then begin
if APPI <= 120 then
Factor := 100 // 100-125% (96-120 DPI): no scaling