| Index: chrome/browser/ui/cocoa/gradient_button_cell.mm
|
| diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.mm b/chrome/browser/ui/cocoa/gradient_button_cell.mm
|
| index 4827cef0a613467092a3308d79a75041ec3da203..f1a5abf82d78567387d6130a636fa1caecf8e6f8 100644
|
| --- a/chrome/browser/ui/cocoa/gradient_button_cell.mm
|
| +++ b/chrome/browser/ui/cocoa/gradient_button_cell.mm
|
| @@ -743,7 +743,6 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
|
| if (shouldClipTheTitle)
|
| [NSBezierPath clipRect:solidPart];
|
|
|
| - CGFloat textLeft = [self textStartXOffset];
|
|
|
| // For some reason, the height of cellFrame as passed in is totally bogus.
|
| // For vertical centering purposes, we need the bounds of the containing
|
| @@ -751,17 +750,15 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
|
| NSRect buttonFrame = [[self controlView] frame];
|
|
|
| // Call the vertical offset to match native NSButtonCell's version.
|
| - textOffset = NSMakePoint(textLeft,
|
| - (NSHeight(buttonFrame) - size.height) / 2 +
|
| - [self verticalTextOffset]);
|
| + textOffset = NSMakePoint(
|
| + NSMinX(cellFrame),
|
| + (NSHeight(buttonFrame) - size.height) / 2 + [self verticalTextOffset]);
|
| // WIth Material Design we want an ellipsis if the title is too long to fit,
|
| // so have to use drawInRect: instead of drawAtPoint:.
|
| if (isModeMaterial) {
|
| - NSRect textBounds = NSMakeRect(textOffset.x,
|
| - textOffset.y,
|
| - NSWidth(buttonFrame) - textOffset.x,
|
| - NSHeight(buttonFrame));
|
| - [title drawInRect:textBounds];
|
| + NSRect textFrame = NSMakeRect(textOffset.x, textOffset.y,
|
| + NSWidth(cellFrame), NSHeight(buttonFrame));
|
| + [title drawInRect:textFrame];
|
| } else {
|
| [title drawAtPoint:textOffset];
|
| }
|
|
|