Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: ash/common/shelf/app_list_button.cc

Issue 2661163003: [Chrome OS] Fix the broken focus rectangle on Launcher icon. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/app_list_button.cc
diff --git a/ash/common/shelf/app_list_button.cc b/ash/common/shelf/app_list_button.cc
index 6ab78cb246c04535783e5dc261b71ffee39e1681..18c545003cea34b2b3c663a3940bce3c4ccac235 100644
--- a/ash/common/shelf/app_list_button.cc
+++ b/ash/common/shelf/app_list_button.cc
@@ -169,20 +169,15 @@ void AppListButton::PaintMd(gfx::Canvas* canvas) {
bg_paint.setStyle(SkPaint::kFill_Style);
canvas->DrawCircle(circle_center, kAppListButtonRadius, bg_paint);
- // Paint a white ring as the foreground. The ceil/dsf math assures that the
- // ring draws sharply and is centered at all scale factors.
Evan Stade 2017/02/01 00:38:13 This logic looks pretty intentional. Are you sure
xdai1 2017/02/01 01:14:06 Sorry for the previous bad fix. Modified as you su
+ // Paint a white ring as the foreground.
const float kRingOuterRadiusDp = 7.f;
const float kRingThicknessDp = 1.5f;
- const float dsf = canvas->UndoDeviceScaleFactor();
- circle_center.Scale(dsf);
-
SkPaint fg_paint;
fg_paint.setFlags(SkPaint::kAntiAlias_Flag);
fg_paint.setStyle(SkPaint::kStroke_Style);
fg_paint.setColor(kShelfIconColor);
- const float thickness = std::ceil(kRingThicknessDp * dsf);
- const float radius = std::ceil(kRingOuterRadiusDp * dsf) - thickness / 2;
- fg_paint.setStrokeWidth(thickness);
+ fg_paint.setStrokeWidth(kRingThicknessDp);
+ const float radius = kRingOuterRadiusDp - kRingThicknessDp / 2;
// Make sure the center of the circle lands on pixel centers.
canvas->DrawCircle(circle_center, radius, fg_paint);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698