Ticket #12981: 0001-InterfaceKit-fixed-BSpinner-s-label-rendering.patch

File 0001-InterfaceKit-fixed-BSpinner-s-label-rendering.patch, 1.3 KB (added by accessays, 7 years ago)
  • src/kits/interface/AbstractSpinner.cpp

    From 0ce4c781b5f91ead7a778da91df29f5429fe271b Mon Sep 17 00:00:00 2001
    From: Wiktor <vikkindhart@gmail.com>
    Date: Mon, 12 Jun 2017 18:13:30 +0200
    Subject: [PATCH] InterfaceKit: fixed BSpinner's label rendering.
    
    A '&' (reference) was missing on a specific line, causing
    font information to never be updated. Also removed extra padding
    dependent on a constant variable - if it is used, the label will
    be render too far down.
    Fixes #12981.
    ---
     src/kits/interface/AbstractSpinner.cpp | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/kits/interface/AbstractSpinner.cpp b/src/kits/interface/AbstractSpinner.cpp
    index a88bc41..3625283 100644
    a b BAbstractSpinner::_DrawLabel(BRect updateRect)  
    14521452    float y = rect.top
    14531453        + roundf((rect.Height() + 1.0f - fontHeight.ascent
    14541454            - fontHeight.descent) / 2.0f)
    1455         + fontHeight.ascent + kFrameMargin * 2;
     1455        + fontHeight.ascent;
    14561456
    14571457    uint32 flags = be_control_look->Flags(this);
    14581458
    BAbstractSpinner::_ValidateLayoutData()  
    16241624    if (fLayoutData->valid)
    16251625        return;
    16261626
    1627     font_height fontHeight = fLayoutData->font_info;
     1627    font_height& fontHeight = fLayoutData->font_info;
    16281628    GetFontHeight(&fontHeight);
    16291629
    16301630    if (Label() != NULL) {