From 2609f86aa38f7d60f99a2c7b16681ff11c7098cb Mon Sep 17 00:00:00 2001 From: "glen@chromium.org" Date: Sat, 9 May 2009 18:38:30 +0000 Subject: Fix NOTREACHED in status bubble if window is made too small. Review URL: http://codereview.chromium.org/100150 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15728 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/status_bubble_views.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc index 6468c7a..e47b4ea 100644 --- a/chrome/browser/views/status_bubble_views.cc +++ b/chrome/browser/views/status_bubble_views.cc @@ -412,10 +412,11 @@ void StatusBubbleViews::StatusView::Paint(ChromeCanvas* canvas) { // to x() and y() for the highlight text, we still won't overlap the shadow. int text_width = std::min(views::Label::GetFont().GetStringWidth(text_), width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding - 1); + int text_height = height - (kShadowThickness * 2) - 1; gfx::Rect body_bounds(kShadowThickness + kTextPositionX, kShadowThickness, - text_width, - height - (kShadowThickness * 2) - 1); + std::max(0, text_width), + std::max(0, text_height)); body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); canvas->DrawStringInt(text_, views::Label::GetFont(), -- cgit v1.1