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

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

Issue 2763693002: [Merge to M58]Chrome OS: Fix the regression of the broken focus rectangle on Launcher icon. (Closed)
Patch Set: Created 3 years, 9 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 361d96b35801b18cf3b221b58177ec62d317de3f..d6940621147ef9515a364b8c66fa1d3bd3802cf8 100644
--- a/ash/common/shelf/app_list_button.cc
+++ b/ash/common/shelf/app_list_button.cc
@@ -133,19 +133,22 @@ void AppListButton::OnPaint(gfx::Canvas* canvas) {
// ring draws sharply and is centered at all scale factors.
const float kRingOuterRadiusDp = 7.f;
const float kRingThicknessDp = 1.5f;
- gfx::ScopedCanvas scoped_canvas(canvas);
- const float dsf = canvas->UndoDeviceScaleFactor();
- circle_center.Scale(dsf);
-
- cc::PaintFlags fg_flags;
- fg_flags.setAntiAlias(true);
- fg_flags.setStyle(cc::PaintFlags::kStroke_Style);
- fg_flags.setColor(kShelfIconColor);
- const float thickness = std::ceil(kRingThicknessDp * dsf);
- const float radius = std::ceil(kRingOuterRadiusDp * dsf) - thickness / 2;
- fg_flags.setStrokeWidth(thickness);
- // Make sure the center of the circle lands on pixel centers.
- canvas->DrawCircle(circle_center, radius, fg_flags);
+
+ {
+ gfx::ScopedCanvas scoped_canvas(canvas);
+ const float dsf = canvas->UndoDeviceScaleFactor();
+ circle_center.Scale(dsf);
+
+ cc::PaintFlags fg_flags;
+ fg_flags.setAntiAlias(true);
+ fg_flags.setStyle(cc::PaintFlags::kStroke_Style);
+ fg_flags.setColor(kShelfIconColor);
+ const float thickness = std::ceil(kRingThicknessDp * dsf);
+ const float radius = std::ceil(kRingOuterRadiusDp * dsf) - thickness / 2;
+ fg_flags.setStrokeWidth(thickness);
+ // Make sure the center of the circle lands on pixel centers.
+ canvas->DrawCircle(circle_center, radius, fg_flags);
+ }
views::Painter::PaintFocusPainter(this, canvas, focus_painter());
}
« 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