From 2bd584904e098aa7cc205afe897c213bc55a637b Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Sun, 19 Dec 2021 00:29:11 +0100 Subject: [PATCH] ideintf/ImageListEditor: Less truncation of loaded large images. (cherry picked from commit ac784af64b8a81fae08855dfef464bbbd94eaa78) --- components/ideintf/imagelisteditor.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/ideintf/imagelisteditor.pp b/components/ideintf/imagelisteditor.pp index b1faf60afb..96c970dc6f 100644 --- a/components/ideintf/imagelisteditor.pp +++ b/components/ideintf/imagelisteditor.pp @@ -612,7 +612,9 @@ var ItemHeight, MaxHeight: Integer; begin ItemHeight := ImageListBox.Canvas.TextHeight('Hg'); - MaxHeight := Scale96ToFont(32); + if ImageList.ResolutionCount > 0 then // smallest image will not be truncated + ItemHeight := Max(ItemHeight, ImageList.ResolutionByIndex[0].Height); + MaxHeight := Scale96ToFont(32); // max height above with next sizes will be truncated for R in ImageList.Resolutions do begin if R.Height <= MaxHeight then