Skip to content

Commit 19b92b2

Browse files
committed
Fixed previous commit, ScaledPixels() is only availbale within a tree control.
1 parent 86038d4 commit 19b92b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/VirtualTrees.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4349,8 +4349,8 @@ function CreateSystemImageSet(pControl: TWinControl): TImageList;
43494349
Res := StyleServices.GetElementSize(BM.Canvas.Handle, StyleServices.GetElementDetails(tbCheckBoxUncheckedNormal), TElementSize.esActual, lSize);
43504350
if not Res then begin
43514351
lSize := TSize.Create(GetSystemMetrics(SM_CXMENUCHECK), GetSystemMetrics(SM_CYMENUCHECK));
4352-
if lSize.cx = 0 then begin
4353-
lSize.cx := ScaledPixels(cDefaultCheckboxSize);
4352+
if lSize.cx = 0 then begin // error? (Should happen rarely only)
4353+
lSize.cx := MulDiv(cDefaultCheckboxSize, Screen.PixelsPerInch, USER_DEFAULT_SCREEN_DPI);
43544354
lSize.cy := lSize.cx;
43554355
end;// if
43564356
end;//if

0 commit comments

Comments
 (0)