Unity 5.6.1f1 Texture2D.PackTextures() BUG

In 5.5.0f3 when using PackTextures() method with padding greater than 0, the result was:
:heavy_check_mark: all textures are packed in a single texture
:heavy_check_mark: wanted padding between each texture is present
:heavy_check_mark: no texture resized if maximumAtlasSize was not met or setup

In 5.6.1f1, the PackTextures() method has changed when padding is greater than 0 and if a texture is for example 256x256 and all others are 16x16:
:heavy_check_mark: all textures are packed in a single texture as before
:heavy_check_mark: wanted padding between each texture is present
:heavy_multiplication_x: some textures inside the atlas could be squished (downscaled with resample) to fit the atlas size even if the maximumAtlasSize is not met or not as parameter! According to my tests, that happens when a texture if way bigger than all the others, it’s like the atlas texture stick to a power of two size, too small to fit the big texture + padding inside, making that big texture smaller… without any way to prevent that!

The bug could come from after 5.5.0f3 and before 5.6.1f1. I’ve not tested versions between.

Attached test project which clearly shows the error/bug I’m talking about.

The generated atlas is downscaling the “tex1” to fit the atlas size with 1 pixel as padding…

EDIT: The bug is not reproduceable if padding is set to 0 or at least half the biggest texture height

3092511–233328–PackTexturesBug.zip (37.6 KB)