Skip to content

Commit 76a955e

Browse files
author
AndroidDeveloperLB
committed
2 parents d63d195 + ab9d311 commit 76a955e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

AutoFitTextViewLibrary/src/com/lb/auto_fit_textview/AutoResizeTextView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ private void adjustTextSize()
201201
final int startSize=(int)_minTextSize;
202202
final int heightLimit=getMeasuredHeight()-getCompoundPaddingBottom()-getCompoundPaddingTop();
203203
_widthLimit=getMeasuredWidth()-getCompoundPaddingLeft()-getCompoundPaddingRight();
204+
if (_widthLimit <= 0)
205+
return;
204206
_availableSpaceRect.right=_widthLimit;
205207
_availableSpaceRect.bottom=heightLimit;
206208
super.setTextSize(TypedValue.COMPLEX_UNIT_PX,efficientTextSizeSearch(startSize,(int)_maxTextSize,_sizeTester,_availableSpaceRect));

0 commit comments

Comments
 (0)