Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| diff --git a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| index e7fe5ee08139e2a5677b96b09af5c2a037611f10..b993bf9690af31dc74c096b688f0a909a15d9b84 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| +++ b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| @@ -12,6 +12,7 @@ |
| #include "skia/ext/skia_utils_mac.h" |
| #import "ui/base/cocoa/nsview_additions.h" |
| #include "ui/base/material_design/material_design_controller.h" |
| +#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| namespace { |
| @@ -132,8 +133,15 @@ void BubbleDecoration::DrawInFrame(NSRect frame, NSView* control_view) { |
| if (label_) { |
| NSRect textRect = frame; |
| textRect.origin.x = textOffset; |
| - textRect.origin.y += baseline_offset_; |
| textRect.size.width = NSMaxX(decoration_frame) - NSMinX(textRect); |
| + // Transform the coordinate system to adjust the baseline. This is the only |
| + // way to get fractional adjustments. |
| + gfx::ScopedNSGraphicsContextSaveGState saveGraphicsState; |
| + if (baseline_offset_) { |
|
tapted
2016/06/22 05:40:38
Nothing currently calls SetBaselineOffset -- you c
shrike
2016/06/22 21:44:50
Acknowledged.
|
| + NSAffineTransform* transform = [NSAffineTransform transform]; |
| + [transform translateXBy:0 yBy:baseline_offset_]; |
| + [transform concat]; |
| + } |
| DrawLabel(label_, attributes_, textRect); |
| } |
| } |