Ticket #2509: ArcTextControl.diff

File ArcTextControl.diff, 1.4 KB (added by shinta, 16 years ago)
  • src/kits/interface/TextControl.cpp

     
    733733    if (fText == NULL) {
    734734        BRect frame(fDivider, bounds.top,
    735735                    bounds.right, bounds.bottom);
    736         // we are stroking the frame around the text view, which
    737         // is 2 pixels wide
    738         frame.InsetBy(2.0, 3.0);
    739         BRect textRect(frame.OffsetToCopy(B_ORIGIN));
    740736
    741         fText = new BPrivate::_BTextInput_(frame, textRect,
     737        fText = new BPrivate::_BTextInput_(frame, frame,
    742738            B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
    743739            B_WILL_DRAW | B_FRAME_EVENTS | navigableFlags);
    744740        AddChild(fText);
  • src/kits/interface/TextInput.cpp

     
    156156    // is one pixel spacing on each side
    157157    BRect textRect(Bounds());
    158158    textRect.left = 0.0;
    159     float vInset = max_c(1, floorf((textRect.Height() - LineHeight(0)) / 2.0));
     159
     160    font_height fontHeight;
     161    GetFontHeight(&fontHeight);
     162
     163    float vInset = max_c(1, floorf((textRect.Height() - fontHeight.ascent
     164        - fontHeight.descent - fontHeight.leading) / 2.0));
    160165    textRect.InsetBy(2, vInset);
    161166    SetTextRect(textRect);
    162167}