On Wed, 10 Mar 2021 20:17:05 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> Fix updated after first round of review.
>
> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 
> 1044:
> 
>> 1042:                         new BufferedImage(iconSize, iconSize, 
>> BufferedImage.TYPE_INT_ARGB);
>> 1043:                 img.setRGB(0, 0, iconSize, iconSize, iconBits, 0, 
>> iconSize);
>> 1044:                 return img;
> 
> There are cases where the size of the buffered image is different from the 
> requested size. It could affect the layout because it breaks the assumption 
> that the returned image has the requested size but it may be larger. (Or is 
> it no longer possible?) I think it should be wrapped into 
> `MultiResolutionIconImage` in this case.

Actually in makeImage we do not use requested size, we return the bits that 
system returns to us. How the generated image is treated depends on the 
implementation of the public methods - where it matters they are wrapped in the 
corresponding multi resolution images so it behaves correctly in UI.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2875

Reply via email to