summaryrefslogtreecommitdiffstats
path: root/ash/frame/header_painter_util.cc
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 15:05:14 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 15:05:14 +0000
commitccd9b3778743563f09e264371e7264cbc00be3e0 (patch)
treef2154c5e904045da4669bd3540c0764b4faebb82 /ash/frame/header_painter_util.cc
parent077eb5efe5b2c0e68e64aba2263ef8c7bd589014 (diff)
downloadchromium_src-ccd9b3778743563f09e264371e7264cbc00be3e0.zip
chromium_src-ccd9b3778743563f09e264371e7264cbc00be3e0.tar.gz
chromium_src-ccd9b3778743563f09e264371e7264cbc00be3e0.tar.bz2
Make the header/content separator into a hairline for apps in hidpi
In order to make the hairline header/content separator look good in HiDPI - The header/content separator overlays the window controls (to avoid a 1 physical pixel gap between the window controls and the header/content separator in 2x) - This CL makes the window controls 2 physical pixels taller in 2x - The bottom 1 physical pixel of the window control images is transparent. This is necessary because the window controls paint on top of the header/content separator BUG=340135 TEST=Manual, see bug R=jamescook@chromium.org Review URL: https://codereview.chromium.org/200493004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/frame/header_painter_util.cc')
-rw-r--r--ash/frame/header_painter_util.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/ash/frame/header_painter_util.cc b/ash/frame/header_painter_util.cc
index 77123e6..ca83824 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);