fix endless loop when dimensions that are not enough to fit one character
Merge pull request #8580 from Dhilan007/v3-labelfix

issue #8492:fix endless loop when dimensions that are not enough to fit one character