summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 22:52:02 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 22:52:02 +0000
commit3094eaca9ef8aef595b1f0fcae2c839dae40a35a (patch)
treef27b3ac2df5a744a93bed82785836fecdc2352bd
parent5be476f95d26c775356b1a991a9238b884aafc57 (diff)
downloadchromium_src-3094eaca9ef8aef595b1f0fcae2c839dae40a35a.zip
chromium_src-3094eaca9ef8aef595b1f0fcae2c839dae40a35a.tar.gz
chromium_src-3094eaca9ef8aef595b1f0fcae2c839dae40a35a.tar.bz2
Merge r34513
------------------------------------------------------------------------ r34513 | estade@chromium.org | 2009-12-14 15:34:45 -0800 (Mon, 14 Dec 2009) | 8 lines Fix badge center-alignment logic. This was initially fixed in r29152. It regressed in r30994. BUG=27648 TEST=see bug Review URL: http://codereview.chromium.org/506003 TBR=aa Review URL: http://codereview.chromium.org/500080 git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@34770 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/common/extensions/extension_action.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/common/extensions/extension_action.cc b/chrome/common/extensions/extension_action.cc
index 088e24c..1f2538e 100755
--- a/chrome/common/extensions/extension_action.cc
+++ b/chrome/common/extensions/extension_action.cc
@@ -137,8 +137,9 @@ void ExtensionAction::PaintBadge(gfx::Canvas* canvas,
rect.fTop = rect.fBottom - SkIntToScalar(kBadgeHeight);
if (badge_width >= kCenterAlignThreshold) {
rect.fLeft = SkIntToScalar(
- SkScalarFloor(SkIntToScalar(bounds.width() / 2.0) -
- SkIntToScalar(badge_width / 2.0)));
+ SkScalarFloor(SkIntToScalar(bounds.x()) +
+ SkIntToScalar(bounds.width() / 2.0) -
+ SkIntToScalar(badge_width / 2.0);
rect.fRight = rect.fLeft + SkIntToScalar(badge_width);
} else {
rect.fRight = SkIntToScalar(bounds.right());