Skip to content

Commit a71ebe7

Browse files
Merge pull request #13 from samskiter/master
Fixed line width measuring
2 parents 2f0e8d4 + defb60f commit a71ebe7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public int onTestSize(final int suggestedSize,final RectF availableSPace)
9595
textRect.bottom=layout.getHeight();
9696
int maxWidth=-1;
9797
for(int i=0;i<layout.getLineCount();i++)
98-
if(maxWidth<layout.getLineWidth(i))
99-
maxWidth=(int)layout.getLineWidth(i);
98+
if(maxWidth<layout.getLineRight(i)-layout.getLineLeft(i))
99+
maxWidth=(int)layout.getLineRight(i)-(int)layout.getLineLeft(i);
100100
textRect.right=maxWidth;
101101
}
102102
textRect.offsetTo(0,0);

0 commit comments

Comments
 (0)