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

Unified Diff: ui/native_theme/native_theme_base.cc

Issue 1187503002: Constrain native theme menu list arrow to the paint rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pdr learns a foreign language known as chromium c++ style Created 5 years, 6 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: ui/native_theme/native_theme_base.cc
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index dcf742cc64d70b4a405b9db12a2463fd58888e77..878882ef54acf0365af6169b410a2de175672b72 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -772,10 +772,22 @@ void NativeThemeBase::PaintMenuList(
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kFill_Style);
+ static const int kArrowWidth = 6;
+ static const int kArrowHeight = 6;
+
+ gfx::Rect arrow(
+ menu_list.arrow_x,
+ menu_list.arrow_y - (kArrowHeight / 2),
+ kArrowWidth,
+ kArrowHeight);
+
+ // Constrain to the paint rect.
+ arrow.Intersect(rect);
+
SkPath path;
- path.moveTo(menu_list.arrow_x, menu_list.arrow_y - 3);
- path.rLineTo(6, 0);
- path.rLineTo(-3, 6);
+ path.moveTo(arrow.x(), arrow.y());
+ path.lineTo(arrow.right(), arrow.y());
+ path.lineTo(arrow.x() + arrow.width() / 2, arrow.bottom());
path.close();
canvas->drawPath(path, 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