Skip to content

Commit

Permalink
[TextFields] Text Input adjustment. (#4389)
Browse files Browse the repository at this point in the history
* [TextFields] Text Input adjustment.

* [TextFields] Turning a number into a const.
  • Loading branch information
willlarche committed Jun 11, 2018
1 parent d8655f5 commit fc61f06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/TextFields/src/MDCTextField.m
Expand Up @@ -40,6 +40,7 @@
// by this amount on each side.
static const CGFloat MDCTextInputClearButtonImageBuiltInPadding = -2.5f;
static const CGFloat MDCTextInputEditingRectRightViewPaddingCorrection = -2.f;
static const CGFloat MDCTextInputTextRectYCorrection = 1.f;

@interface MDCTextField () {
UIColor *_cursorColor;
Expand Down Expand Up @@ -522,7 +523,7 @@ - (CGRect)textRectForBounds:(CGRect)bounds {
(CGRectGetHeight(bounds) / 2.f) - MDCRint(MAX(self.font.lineHeight,
self.placeholderLabel.font.lineHeight) /
2.f); // Text field or placeholder
actualY = textInsets.top - actualY;
actualY = textInsets.top - actualY + MDCTextInputTextRectYCorrection;
textRect.origin.y = actualY;

if (self.mdf_effectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft) {
Expand Down

0 comments on commit fc61f06

Please sign in to comment.