From 405bf9da6e53ae850adb08296b983680e742e136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 10 Feb 2006 17:10:42 +0000 Subject: [PATCH] InnerFrame() used fLabelBox, but it has to take the font's descent into account. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16336 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Box.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp index b0194a292a..4a60c24066 100644 --- a/src/kits/interface/Box.cpp +++ b/src/kits/interface/Box.cpp @@ -114,9 +114,13 @@ BBox::InnerFrame() : Border() == B_PLAIN_BORDER ? 1.0f : 0.0f; float labelHeight = 0.0f; - if (fLabel != NULL) - labelHeight = fLabelBox->Height(); - else if (fLabelView != NULL) + if (fLabel != NULL) { + // fLabelBox doesn't contain the font's descent, but we want it here + font_height fontHeight; + GetFontHeight(&fontHeight); + + labelHeight = ceilf(fontHeight.ascent + fontHeight.descent); + } else if (fLabelView != NULL) labelHeight = fLabelView->Bounds().Height(); BRect rect = Bounds().InsetByCopy(borderSize, borderSize);