Skip to content

Commit a33b0c8

Browse files
committed
Merge pull request #12 from jameshurst/master
Fixed textViewHeight calculation for iOS 9
2 parents d256c9c + 8f28b98 commit a33b0c8

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

CSGrowingTextView/CSGrowingTextView/CSGrowingTextView.m

+2-11
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,8 @@ - (CGFloat)textViewHeight {
242242
_internalTextView.textContainerInset.top + _internalTextView.textContainerInset.bottom :
243243
-iOS6Insets.top + (-iOS6Insets.bottom));
244244

245-
CGFloat lineHeight = _internalTextView.font.lineHeight;
246-
if (lineHeight) {
247-
lineHeight = (lineHeight - (NSInteger)lineHeight < 0.5 ?
248-
lineHeight - (lineHeight - (NSInteger)lineHeight) + 0.5 :
249-
ceil(lineHeight));
250-
251-
return ceil(lineHeight * lines + insets);
252-
}
253-
else {
254-
return ceil(lineHeight * lines + insets);
255-
}
245+
CGFloat lineHeight = ceil(_internalTextView.font.lineHeight);
246+
return ceil(lineHeight * lines + insets);
256247
}
257248

258249
#pragma mark - Responders

0 commit comments

Comments
 (0)