Ticket #13238: 0001-ControlLook-Fix-redraw-issues-introduced-in-hrev5089.patch

File 0001-ControlLook-Fix-redraw-issues-introduced-in-hrev5089.patch, 3.4 KB (added by KapiX, 8 years ago)
  • src/kits/interface/ControlLook.cpp

    From c5298440eab9ab1bac844d41a642d8c5b0e5fd7e Mon Sep 17 00:00:00 2001
    From: Kacper Kasper <kacperkasper@gmail.com>
    Date: Sun, 29 Jan 2017 21:13:01 +0100
    Subject: [PATCH] ControlLook: Fix redraw issues introduced in hrev50893.
    
    * I was pretty sure that I didn't change the logic, but turns out
      I was wrong. Sorry about that.
    * Adjusted copy-pasted comments.
    ---
     src/kits/interface/ControlLook.cpp | 15 ++++++++++-----
     1 file changed, 10 insertions(+), 5 deletions(-)
    
    diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp
    index 7a00152..fbaadad 100644
    a b BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,  
    14451445            clipping.Exclude(leftBottomCorner);
    14461446            clipping.Exclude(rightBottomCorner);
    14471447
    1448             // draw the left top corner
     1448            // draw the left bottom corner
    14491449            _DrawRoundCornerLeftBottom(view, leftBottomCorner, updateRect, base,
    14501450                edgeShadowColor, edgeLightColor, frameLightColor,
    14511451                frameShadowColor, bevelLightColor, bevelShadowColor,
    14521452                fillGradient);
    1453             // draw the right top corner
     1453            // draw the right bottom corner
    14541454            _DrawRoundCornerRightBottom(view, rightBottomCorner, updateRect,
    14551455                base, edgeLightColor, frameShadowColor, bevelShadowColor,
    14561456                fillGradient);
    BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,  
    14631463            _DrawRoundCornerLeftTop(view, leftTopCorner, updateRect, base,
    14641464                edgeShadowColor, frameLightColor, bevelLightColor,
    14651465                fillGradient);
    1466             // draw the left top corner
     1466            // draw the left bottom corner
    14671467            _DrawRoundCornerLeftBottom(view, leftBottomCorner, updateRect, base,
    14681468                edgeShadowColor, edgeLightColor, frameLightColor,
    14691469                frameShadowColor, bevelLightColor, bevelShadowColor,
    BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,  
    14781478                edgeShadowColor, edgeLightColor, frameLightColor,
    14791479                frameShadowColor, bevelLightColor, bevelShadowColor,
    14801480                fillGradient);
    1481             // draw the right top corner
     1481            // draw the right bottom corner
    14821482            _DrawRoundCornerRightBottom(view, rightBottomCorner, updateRect,
    14831483                base, edgeLightColor, frameShadowColor, bevelShadowColor,
    14841484                fillGradient);
    BControlLook::DrawInactiveTab(BView* view, BRect& rect, const BRect& updateRect,  
    15691569        fillGradient.AddColor(tint_color(base, 1.08), 255);
    15701570    }
    15711571
     1572    BRect background = rect;
    15721573    uint32 bordersToDraw = 0;
    15731574    switch (side) {
    15741575        case B_TOP_BORDER:
    15751576            bordersToDraw = (B_LEFT_BORDER | B_TOP_BORDER | B_RIGHT_BORDER);
    15761577            rect.top += 4;
     1578            background.bottom = rect.top;
    15771579            break;
    15781580        case B_BOTTOM_BORDER:
    15791581            bordersToDraw = (B_LEFT_BORDER | B_BOTTOM_BORDER | B_RIGHT_BORDER);
    15801582            rect.bottom -= 4;
     1583            background.top = rect.bottom;
    15811584            break;
    15821585        case B_LEFT_BORDER:
    15831586            bordersToDraw = (B_LEFT_BORDER | B_BOTTOM_BORDER | B_TOP_BORDER);
    15841587            rect.left += 4;
     1588            background.right = rect.left;
    15851589            break;
    15861590        case B_RIGHT_BORDER:
    15871591            bordersToDraw = (B_RIGHT_BORDER | B_BOTTOM_BORDER | B_TOP_BORDER);
    15881592            rect.right -= 4;
     1593            background.left = rect.right;
    15891594        break;
    15901595    }
    15911596
    15921597    // active tabs stand out at the top, but this is an inactive tab
    15931598    view->SetHighColor(base);
    1594     view->FillRect(rect);
     1599    view->FillRect(background);
    15951600
    15961601    // frame and fill
    15971602    _DrawFrame(view, rect, edgeShadowColor, edgeShadowColor, edgeLightColor,