Sometimes scrollbars which are initially visible disappear when adjusting text size. This breaks the logic and forces the smallest possible text size.
The issue is here:
// Binary search for best fit
while (low <= high) {
mid = parseInt((low + high) / 2, 10);
innerSpan.style.fontSize = mid + 'px';
if(innerSpan.scrollWidth <= originalWidth && (settings.widthOnly || innerSpan.scrollHeight <= originalHeight)){
low = mid + 1;
} else {
high = mid - 1;
}
}
When text becomes smaller, scrollbars which are initially visible may disappear. Then innerSpan.scrollWidth becomes larger than originalWidth, thus forcing to make the text size even smaller.
Sometimes scrollbars which are initially visible disappear when adjusting text size. This breaks the logic and forces the smallest possible text size.
The issue is here:
When text becomes smaller, scrollbars which are initially visible may disappear. Then
innerSpan.scrollWidth
becomes larger thanoriginalWidth
, thus forcing to make the text size even smaller.