Chromium Code Reviews| Index: ash/common/shelf/shelf_button.cc |
| diff --git a/ash/common/shelf/shelf_button.cc b/ash/common/shelf/shelf_button.cc |
| index b39fa9c2f785d3bd2c4c23ae58b1dd20de0d3ccc..5df12a6ec062139f3f8eddb91694e534ebf78624 100644 |
| --- a/ash/common/shelf/shelf_button.cc |
| +++ b/ash/common/shelf/shelf_button.cc |
| @@ -146,11 +146,23 @@ class ShelfButton::AppStatusIndicatorView |
| DCHECK_EQ(width(), height()); |
| DCHECK_EQ(kIndicatorRadiusDip, width() / 2); |
| + const float dsf = canvas->UndoDeviceScaleFactor(); |
|
Daniel Erat
2017/03/03 23:15:52
i don't know much about device scale factors, but
Evan Stade
2017/03/04 01:02:22
the scopedcanvas above takes care of that. Technic
Daniel Erat
2017/03/04 01:17:05
ah, sorry. i missed both the fact that a ScopedCan
|
| + const int kStrokeWidthPx = 1; |
| + gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint(); |
| + center.Scale(dsf); |
| + |
| + // Fill the center. |
| cc::PaintFlags flags; |
| flags.setColor(kIndicatorColor); |
| flags.setFlags(cc::PaintFlags::kAntiAlias_Flag); |
| - canvas->DrawCircle(gfx::Point(width() / 2, height() / 2), |
| - kIndicatorRadiusDip, flags); |
| + canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx, |
| + flags); |
| + |
| + // Stroke the border. |
| + flags.setColor(SkColorSetA(SK_ColorBLACK, 0x29)); |
| + flags.setStyle(SkPaint::kStroke_Style); |
| + canvas->DrawCircle( |
| + center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags); |
| } |
| // ShelfButtonAnimation::Observer |