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
This commit is contained in:
Axel Dörfler 2006-02-10 17:10:42 +00:00
parent ef4aa90f49
commit 405bf9da6e
1 changed files with 7 additions and 3 deletions

View File

@ -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);