Skip to content

Commit

Permalink
[textfield] implement editingrectforbounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Metral committed Feb 27, 2013
1 parent eba82dc commit a2af952
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/textfield/src/NITextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ -(void)drawPlaceholderInRect:(CGRect)rect
}
}

-(CGRect)editingRectForBounds:(CGRect)bounds
{
if (UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, self.textInsets)) {
return [super editingRectForBounds:bounds];
}
UIEdgeInsets i = self.textInsets;
return CGRectMake(bounds.origin.x + i.left, bounds.origin.y + i.top,
bounds.size.width - i.left - i.right, bounds.size.height - i.top - i.bottom);
}

-(CGRect)textRectForBounds:(CGRect)bounds
{
if (UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, self.textInsets)) {
Expand Down

0 comments on commit a2af952

Please sign in to comment.