Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix line at the top of text editor #29

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Fix line above the text
If rect.size.height (line 323) is not round for example 320.01 sometimes tiny lines appears above editable text (it disappears after few attempts to select text), with round height value problem is not appears.

I found it in Seafile iOS client when trying to edit text.
  • Loading branch information
34x committed Aug 28, 2015
commit b2a855d303f919d6667c2701d3a50affa4ab298b
1 change: 1 addition & 0 deletions EGOTextView/EGOTextView.m
Original file line number Diff line number Diff line change
@@ -321,6 +321,7 @@ - (void)textChanged {
CGRect rect = _textContentView.frame;
CGFloat height = [self boundingHeightForWidth:rect.size.width];
rect.size.height = height+self.font.lineHeight;
rect.size.height = round(rect.size.height);
_textContentView.frame = rect;
self.contentSize = CGSizeMake(self.frame.size.width, rect.size.height+(self.font.lineHeight*2));