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

Unified Diff: ash/frame/header_painter_util.cc

Issue 200493004: Make the header/content separator into a hairline for apps in hidpi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: ash/frame/header_painter_util.cc
diff --git a/ash/frame/header_painter_util.cc b/ash/frame/header_painter_util.cc
index 77123e6f4f8d2f93af26b03324dbb49139e6c265..ca838248ec5b96b6eb1a4a23ee4392df92ed034e 100644
--- a/ash/frame/header_painter_util.cc
+++ b/ash/frame/header_painter_util.cc
@@ -74,10 +74,9 @@ gfx::Rect HeaderPainterUtil::GetTitleBounds(
int x = icon ?
icon->bounds().right() + kTitleIconOffsetX : kTitleNoIconOffsetX;
int height = title_font_list.GetHeight();
- int y = std::max(
- 0,
- static_cast<int>(std::ceil(
- (caption_button_container->height() - height) / 2.0f)));
+ // Floor when computing the center of |caption_button_container| and when
+ // computing the center of the text.
+ int y = std::max(0, (caption_button_container->height() / 2) - (height / 2));
int width = std::max(
0, caption_button_container->x() - kTitleCaptionButtonSpacing - x);
return gfx::Rect(x, y, width, height);

Powered by Google App Engine
This is Rietveld 408576698