From 160f5f5e2f5f41fb13839c6d648e9b802cd0f609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 10 Apr 2009 08:29:05 +0000 Subject: [PATCH] Patch by Philippe Saint-Pierre: Don't use BTextView::LineHeight() when the font has not yet been set... Thanks a lot! D'oh, this one made me slap my hand against my forehead! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30101 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskcalc/CalcView.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/apps/deskcalc/CalcView.cpp b/src/apps/deskcalc/CalcView.cpp index eb0ec4b1e3..2328158d50 100644 --- a/src/apps/deskcalc/CalcView.cpp +++ b/src/apps/deskcalc/CalcView.cpp @@ -6,6 +6,7 @@ * Authors: * Timothy Wayper * Stephan Aßmus + * Philippe Saint-Pierre, stpere@gmail.com */ #include "CalcView.h" @@ -656,16 +657,16 @@ CalcView::FrameResized(float width, float height) fExpressionTextView->MoveTo(frame.LeftTop()); fExpressionTextView->ResizeTo(frame.Width(), frame.Height()); - frame.OffsetTo(B_ORIGIN); - float inset = (frame.Height() - fExpressionTextView->LineHeight(0)) / 2; - frame.InsetBy(inset, inset); - fExpressionTextView->SetTextRect(frame); - // configure expression text view font size and color float sizeDisp = fShowKeypad ? fHeight * kDisplayScaleY : fHeight; BFont font(be_bold_font); font.SetSize(sizeDisp * kExpressionFontScaleY); fExpressionTextView->SetFontAndColor(&font, B_FONT_ALL); + + frame.OffsetTo(B_ORIGIN); + float inset = (frame.Height() - fExpressionTextView->LineHeight(0)) / 2; + frame.InsetBy(inset, inset); + fExpressionTextView->SetTextRect(frame); }