Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ @implementation RCTUITextFieldCell

- (NSRect)titleRectForBounds:(NSRect)rect
{
return UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
NSRect titleRect = UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
// Center the intrinsic text height within the padded control bounds.
CGFloat contentHeight = self.cellSize.height;
if (contentHeight < titleRect.size.height) {
titleRect.origin.y += (titleRect.size.height - contentHeight) / 2;
titleRect.size.height = contentHeight;
}
return titleRect;
}

- (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate event:(NSEvent *)event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ @implementation RCTUISecureTextFieldCell

- (NSRect)titleRectForBounds:(NSRect)rect
{
return UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
NSRect titleRect = UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
// Center the intrinsic text height within the padded control bounds.
CGFloat contentHeight = self.cellSize.height;
if (contentHeight < titleRect.size.height) {
titleRect.origin.y += (titleRect.size.height - contentHeight) / 2;
titleRect.size.height = contentHeight;
}
return titleRect;
}

- (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate event:(NSEvent *)event
Expand Down
Loading