Commit 24fa1597 authored by rsesek@chromium.org's avatar rsesek@chromium.org

[Mac] Do not draw pinned tab favicons on half pixels.

BUG=96490
TEST=Pin a tab and inspect the icon. It's not blurry/fuzzy.


Review URL: http://codereview.chromium.org/7969017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102416 0039d316-1c4b-4281-b951-d872f2087c98
parent 70d6650d
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
#include <cmath>
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#import "chrome/browser/themes/theme_service.h" #import "chrome/browser/themes/theme_service.h"
#import "chrome/browser/ui/cocoa/menu_controller.h" #import "chrome/browser/ui/cocoa/menu_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h" #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h"
#import "chrome/browser/ui/cocoa/tabs/tab_view.h" #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
#import "chrome/browser/ui/cocoa/themed_window.h" #import "chrome/browser/ui/cocoa/themed_window.h"
...@@ -193,7 +196,8 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate { ...@@ -193,7 +196,8 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate {
: [TabController miniTabWidth]; : [TabController miniTabWidth];
// Center the icon. // Center the icon.
appIconFrame.origin.x = (tabWidth - NSWidth(appIconFrame)) / 2.0; appIconFrame.origin.x =
std::floor((tabWidth - NSWidth(appIconFrame)) / 2.0);
[iconView_ setFrame:appIconFrame]; [iconView_ setFrame:appIconFrame];
} else { } else {
[iconView_ setFrame:originalIconFrame_]; [iconView_ setFrame:originalIconFrame_];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment