Skip to content

Commit

Permalink
simplify CGRect math
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazyod committed Jul 17, 2015
1 parent 54f52da commit 2bb26e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cocos/ui/UIEditBox/UIEditBoxImpl-ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ - (CGRect)textRectForBounds:(CGRect)bounds
auto glview = cocos2d::Director::getInstance()->getOpenGLView();

float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor();
return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding,
bounds.size.width - padding*2, bounds.size.height - padding*2);
return CGRectInset(bounds, padding, padding);
}

- (CGRect)editingRectForBounds:(CGRect)bounds
Expand Down

0 comments on commit 2bb26e3

Please sign in to comment.