We need to take into account the main item's dimensions in the minimum width and height properties. (cherry picked from commit f11ce7b9)