* Key font size now also takes the window width into account.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29207 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2009-02-15 12:58:09 +00:00
parent 816f925d39
commit a1056d5fa3
1 changed files with 8 additions and 1 deletions

View File

@ -39,6 +39,7 @@
const uint8 K_COLOR_OFFSET = 32;
const float K_FONT_YPROP = 0.6f;
const float K_FONT_XPROP = 0.6f;
const float K_DISPLAY_YPROP = 0.2f;
enum {
@ -374,7 +375,13 @@ CalcView::Draw(BRect updateRect)
SetHighColor(fButtonTextColor);
SetLowColor(fBaseColor);
SetDrawingMode(B_OP_COPY);
SetFontSize(((fHeight - sizeDisp) / (float)fRows) * K_FONT_YPROP);
float fontSize =
min_c(((fHeight - sizeDisp) / (float)fRows) * K_FONT_YPROP,
(fWidth / (float)fColums) * K_FONT_XPROP);
SetFontSize(fontSize);
float baselineOffset = ((fHeight - sizeDisp) / (float)fRows)
* (1.0 - K_FONT_YPROP) * 0.5;
CalcKey *key = fKeypad;