~ubuntu-branches/ubuntu/jaunty/kde4libs/jaunty-updates

« back to all changes in this revision

Viewing changes to khtml/rendering/render_object.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter
  • Date: 2008-12-11 18:26:08 UTC
  • mfrom: (1.1.24 upstream)
  • Revision ID: james.westby@ubuntu.com-20081211182608-tsu6p8ncbw1gnqxt
Tags: 4:4.1.85-0ubuntu1
* New upstream release
* Patches:
  + Removed 15_kfreebsd_support.diff from patches/series (doesn't apply and
    has no use for Ubuntu)
  + Redid 20_use_dejavu_as_default_font.diff
  + Completely removed kubuntu_09_fix_application_menu.diff (applied upstream)
  + Refreshed kubuntu_54_use_xdg_menu_prefix.diff
  + Dropped plasma/widgets/toolbutton.cpp from kubuntu_qt_ftbfs.diff (applied
    upstream)
  + Global quilt refresh

Show diffs side-by-side

added added

removed removed

Lines of Context:
1185
1185
        p->setCompositionMode(QPainter::CompositionMode_SourceOver);
1186
1186
}
1187
1187
 
 
1188
void RenderObject::adjustBorderRadii(BorderRadii &tl, BorderRadii &tr, BorderRadii &bl, BorderRadii &br, int w, int h) const
 
1189
{
 
1190
    // CSS Backgrounds and Borders Module Level 3 (WD-css3-background-20080910), chapter 4.5:
 
1191
    // "  Corners do not overlap: When the sum of two adjacent corner radii exceeds the size of the border box,
 
1192
    //  UAs must reduce one or more of the radii. The algorithm for reducing radii is as follows:"
 
1193
    //  The sum of two adjacent radii may not be more than the width or height (whichever is relevant) of the box.
 
1194
    //  If any sum exceeds that value, all radii are reduced according to the following formula:"
 
1195
    const int horS = qMax(tl.horizontal + tr.horizontal, bl.horizontal + br.horizontal);
 
1196
    const int verS = qMax(tl.vertical + bl.vertical, tr.vertical + br.vertical);
 
1197
 
 
1198
    qreal f = 1.0;
 
1199
    if (horS > 0)
 
1200
        f = qMin(f, w / qreal(horS));
 
1201
    if (verS > 0)
 
1202
        f = qMin(f, h / qreal(verS));
 
1203
 
 
1204
    if (f < 1.0) {
 
1205
        tl.horizontal *= f;
 
1206
        tr.horizontal *= f;
 
1207
        bl.horizontal *= f;
 
1208
        br.horizontal *= f;
 
1209
        tl.vertical   *= f;
 
1210
        tr.vertical   *= f;
 
1211
        bl.vertical   *= f;
 
1212
        br.vertical   *= f;
 
1213
    }
 
1214
}
 
1215
 
1188
1216
static QImage blendCornerImages(const QImage &image1, const QImage &image2)
1189
1217
{
1190
1218
    QImage mask(image1.size(), QImage::Format_ARGB32_Premultiplied);
1301
1329
 
1302
1330
            QImage image2 = image1;
1303
1331
 
1304
 
            const QRect outerRect  = image1.rect();
1305
 
            const QRect innerRect  = outerRect.adjusted(horThickness, vertThickness, -horThickness, -vertThickness);
1306
 
 
1307
1332
            const QColor c1 = style == OUTSET ? dark : light;
1308
1333
            const QColor c2 = style == OUTSET ? light : dark;
1309
1334
 
1310
 
            QPainterPath path;
1311
 
            path.arcMoveTo(outerRect, angleStart);
1312
 
            path.arcTo(outerRect, angleStart, angleSpan);
1313
 
            if (innerRect.isValid())
1314
 
                path.arcTo(innerRect, angleStart + angleSpan, -angleSpan);
1315
 
            else
1316
 
                path.lineTo(radius.horizontal, radius.vertical);
1317
 
            path.closeSubpath();
1318
 
 
1319
1335
            QPainter p2;
1320
1336
            p2.begin(&image1);
1321
 
            p2.setRenderHint(QPainter::Antialiasing);
1322
 
            p2.fillPath(path, c1);
 
1337
            drawBorderArc(&p2, radius.horizontal, radius.vertical, horThickness, vertThickness,
 
1338
                          radius, angleStart, angleSpan, c1, textColor, SOLID);
1323
1339
            p2.end();
1324
1340
 
1325
1341
            p2.begin(&image2);
1326
 
            p2.setRenderHint(QPainter::Antialiasing);
1327
 
            p2.fillPath(path, c2);
 
1342
            drawBorderArc(&p2, radius.horizontal, radius.vertical, horThickness, vertThickness,
 
1343
                          radius, angleStart, angleSpan, c2, textColor, SOLID);
1328
1344
            p2.end();
1329
1345
 
1330
1346
            p->drawImage(x - radius.horizontal, y - radius.vertical, blendCornerImages(image1, image2));
1331
1347
            break;
1332
1348
        }
1333
1349
 
1334
 
        // We could implement this by adjusting the coordinates and calling drawBorderArc() twice,
1335
 
        // with INSET and OUTSET, but this should be more efficient.
1336
1350
        case RIDGE:
1337
1351
        case GROOVE:
1338
1352
        {
1341
1355
 
1342
1356
            QImage image2 = image1;
1343
1357
 
1344
 
            const QRect outerRect  = image1.rect();
1345
 
            const QRect centerRect = outerRect.adjusted(horThickness / 2, vertThickness / 2,
1346
 
                                                        -(horThickness / 2), -(vertThickness / 2));
1347
 
            const QRect innerRect  = outerRect.adjusted(horThickness, vertThickness, -horThickness, -vertThickness);
1348
 
 
1349
1358
            const QColor c1 = style == RIDGE ? dark : light;
1350
1359
            const QColor c2 = style == RIDGE ? light : dark;
1351
1360
 
1352
 
            QPainterPath outer, inner;
1353
 
            outer.arcMoveTo(outerRect, angleStart);
1354
 
            outer.arcTo(outerRect, angleStart, angleSpan);
1355
 
            if (centerRect.isValid())
1356
 
                outer.arcTo(centerRect, angleStart + angleSpan, -angleSpan);
1357
 
            else
1358
 
                outer.lineTo(radius.horizontal, radius.vertical);
1359
 
            outer.closeSubpath();
 
1361
            const qreal hw = horThickness / 2;
 
1362
            const qreal vw = vertThickness / 2;
 
1363
            int cx = radius.horizontal;
 
1364
            int cy = radius.vertical;
1360
1365
 
1361
 
            if (centerRect.isValid()) {
1362
 
                inner.arcMoveTo(centerRect, angleStart);
1363
 
                inner.arcTo(centerRect, angleStart, angleSpan);
1364
 
                if (innerRect.isValid())
1365
 
                    inner.arcTo(innerRect, angleStart + angleSpan, -angleSpan);
1366
 
                else
1367
 
                    inner.lineTo(radius.horizontal, radius.vertical);
1368
 
                inner.closeSubpath();
1369
 
            }
 
1366
            BorderRadii innerRadius;
 
1367
            innerRadius.horizontal = radius.horizontal - hw;
 
1368
            innerRadius.vertical = radius.vertical - vw;
1370
1369
 
1371
1370
            QPainter p2;
1372
1371
            p2.begin(&image1);
1373
 
            p2.setRenderHint(QPainter::Antialiasing);
1374
 
            p2.fillPath(outer, c1);
1375
 
            p2.fillPath(inner, c2);
 
1372
            drawBorderArc(&p2, cx, cy, hw, vw, radius, angleStart, angleSpan, c1, textColor, SOLID);
 
1373
            drawBorderArc(&p2, cx, cy, hw, vw, innerRadius, angleStart, angleSpan, c2, textColor, SOLID);
1376
1374
            p2.end();
1377
1375
 
1378
1376
            p2.begin(&image2);
1379
 
            p2.setRenderHint(QPainter::Antialiasing);
1380
 
            p2.fillPath(outer, c2);
1381
 
            p2.fillPath(inner, c1);
 
1377
            drawBorderArc(&p2, cx, cy, hw, vw, radius, angleStart, angleSpan, c2, textColor, SOLID);
 
1378
            drawBorderArc(&p2, cx, cy, hw, vw, innerRadius, angleStart, angleSpan, c1, textColor, SOLID);
1382
1379
            p2.end();
1383
1380
 
1384
1381
            p->drawImage(x - radius.horizontal, y - radius.vertical, blendCornerImages(image1, image2));
1417
1414
    bool render_r = rs > BHIDDEN && end && !rt;
1418
1415
    bool render_b = bs > BHIDDEN && !bt;
1419
1416
 
1420
 
    // Need sufficient width and height to contain border radius curves.  Sanity check our border radii
1421
 
    // and our width/height values to make sure the curves can all fit. If not, then we won't paint
1422
 
    // any border radii.
1423
 
    bool renderRadii = false;
1424
1417
    BorderRadii topLeft = style->borderTopLeftRadius();
1425
1418
    BorderRadii topRight = style->borderTopRightRadius();
1426
1419
    BorderRadii bottomLeft = style->borderBottomLeftRadius();
1427
1420
    BorderRadii bottomRight = style->borderBottomRightRadius();
1428
1421
 
1429
 
    if (style->hasBorderRadius() &&
1430
 
        static_cast<unsigned>(w) >= static_cast<unsigned>(topLeft.horizontal) + static_cast<unsigned>(topRight.horizontal) &&
1431
 
        static_cast<unsigned>(w) >= static_cast<unsigned>(bottomLeft.horizontal) + static_cast<unsigned>(bottomRight.horizontal) &&
1432
 
        static_cast<unsigned>(h) >= static_cast<unsigned>(topLeft.vertical) + static_cast<unsigned>(bottomLeft.vertical) &&
1433
 
        static_cast<unsigned>(h) >= static_cast<unsigned>(topRight.vertical) + static_cast<unsigned>(bottomRight.vertical))
1434
 
        renderRadii = true;
 
1422
    if (style->hasBorderRadius()) {
 
1423
        // Adjust the border radii so they don't overlap when taking the size of the box
 
1424
        // into account.
 
1425
        adjustBorderRadii(topLeft, topRight, bottomLeft, bottomRight, w, h);
 
1426
   }
1435
1427
 
1436
1428
    bool upperLeftBorderStylesMatch = render_l && (ts == ls) && (tc == lc);
1437
1429
    bool upperRightBorderStylesMatch = render_r && (ts == rs) && (tc == rc);
1439
1431
    bool lowerRightBorderStylesMatch = render_r && (bs == rs) && (bc == rc);
1440
1432
 
1441
1433
    if(render_t) {
1442
 
        bool ignore_left = (renderRadii && topLeft.horizontal > 0) ||
 
1434
        bool ignore_left = (topLeft.horizontal > 0) ||
1443
1435
            ((tc == lc) && (tt == lt) &&
1444
1436
             (ts >= OUTSET) &&
1445
1437
             (ls == DOTTED || ls == DASHED || ls == SOLID || ls == OUTSET));
1446
1438
 
1447
 
        bool ignore_right = (renderRadii && topRight.horizontal > 0) ||
 
1439
        bool ignore_right = (topRight.horizontal > 0) ||
1448
1440
            ((tc == rc) && (tt == rt) &&
1449
1441
             (ts >= OUTSET) &&
1450
1442
             (rs == DOTTED || rs == DASHED || rs == SOLID || rs == INSET));
1451
1443
 
1452
 
        int x = _tx;
1453
 
        int x2 = _tx + w;
1454
 
        if (renderRadii) {
1455
 
            x += topLeft.horizontal;
1456
 
            x2 -= topRight.horizontal;
1457
 
        }
 
1444
        int x = _tx + topLeft.horizontal;
 
1445
        int x2 = _tx + w - topRight.horizontal;
1458
1446
 
1459
1447
        drawBorder(p, x, _ty, x2, _ty +  style->borderTopWidth(), BSTop, tc, style->color(), ts,
1460
1448
                   ignore_left?0:style->borderLeftWidth(),
1461
1449
                   ignore_right?0:style->borderRightWidth());
1462
1450
 
1463
 
        if (renderRadii) {
1464
 
            if (topLeft.hasBorderRadius()) {
1465
 
                int x = _tx + topLeft.horizontal;
1466
 
                int y = _ty + topLeft.vertical;
1467
 
                int startAngle = 90;
1468
 
                int span = upperLeftBorderStylesMatch ? 90 : 45;
1469
 
 
1470
 
                // Draw the upper left arc
1471
 
                drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderTopWidth(),
1472
 
                              topLeft, startAngle, span, tc, style->color(), ts);
1473
 
            }
1474
 
 
1475
 
            if (topRight.hasBorderRadius()) {
1476
 
                int x = _tx + w - topRight.horizontal;
1477
 
                int y = _ty + topRight.vertical;
1478
 
                int startAngle = 90;
1479
 
                int span = upperRightBorderStylesMatch ? -90 : -45;
1480
 
 
1481
 
                // Draw the upper right arc
1482
 
                drawBorderArc(p, x, y, style->borderRightWidth(), style->borderTopWidth(),
1483
 
                              topRight, startAngle, span, tc, style->color(), ts);
1484
 
            }
 
1451
        if (topLeft.hasBorderRadius()) {
 
1452
            int x = _tx + topLeft.horizontal;
 
1453
            int y = _ty + topLeft.vertical;
 
1454
            int startAngle = 90;
 
1455
            int span = upperLeftBorderStylesMatch ? 90 : 45;
 
1456
 
 
1457
            // Draw the upper left arc
 
1458
            drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderTopWidth(),
 
1459
                          topLeft, startAngle, span, tc, style->color(), ts);
 
1460
        }
 
1461
 
 
1462
        if (topRight.hasBorderRadius()) {
 
1463
            int x = _tx + w - topRight.horizontal;
 
1464
            int y = _ty + topRight.vertical;
 
1465
            int startAngle = 90;
 
1466
            int span = upperRightBorderStylesMatch ? -90 : -45;
 
1467
 
 
1468
            // Draw the upper right arc
 
1469
            drawBorderArc(p, x, y, style->borderRightWidth(), style->borderTopWidth(),
 
1470
                          topRight, startAngle, span, tc, style->color(), ts);
1485
1471
        }
1486
1472
    }
1487
1473
 
1488
1474
    if(render_b) {
1489
 
        bool ignore_left = (renderRadii && bottomLeft.horizontal > 0) ||
 
1475
        bool ignore_left = (bottomLeft.horizontal > 0) ||
1490
1476
            ((bc == lc) && (bt == lt) &&
1491
1477
             (bs >= OUTSET) &&
1492
1478
             (ls == DOTTED || ls == DASHED || ls == SOLID || ls == OUTSET));
1493
1479
 
1494
 
        bool ignore_right = (renderRadii && bottomRight.horizontal > 0) ||
 
1480
        bool ignore_right = (bottomRight.horizontal > 0) ||
1495
1481
            ((bc == rc) && (bt == rt) &&
1496
1482
             (bs >= OUTSET) &&
1497
1483
             (rs == DOTTED || rs == DASHED || rs == SOLID || rs == INSET));
1498
1484
 
1499
 
        int x = _tx;
1500
 
        int x2 = _tx + w;
1501
 
        if (renderRadii) {
1502
 
            x += bottomLeft.horizontal;
1503
 
            x2 -= bottomRight.horizontal;
1504
 
        }
 
1485
        int x = _tx + bottomLeft.horizontal;
 
1486
        int x2 = _tx + w - bottomRight.horizontal;
1505
1487
 
1506
1488
        drawBorder(p, x, _ty + h - style->borderBottomWidth(), x2, _ty + h, BSBottom, bc, style->color(), bs,
1507
1489
                   ignore_left?0:style->borderLeftWidth(),
1508
1490
                   ignore_right?0:style->borderRightWidth());
1509
1491
 
1510
 
         if (renderRadii) {
1511
 
            if (bottomLeft.hasBorderRadius()) {
1512
 
                int x = _tx + bottomLeft.horizontal;
1513
 
                int y = _ty + h - bottomLeft.vertical;
1514
 
                int startAngle = 270;
1515
 
                int span = lowerLeftBorderStylesMatch ? -90 : -45;
1516
 
 
1517
 
                // Draw the bottom left arc
1518
 
                drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderBottomWidth(),
1519
 
                              bottomLeft, startAngle, span, bc, style->color(), bs);
1520
 
            }
1521
 
 
1522
 
            if (bottomRight.hasBorderRadius()) {
1523
 
                int x = _tx + w - bottomRight.horizontal;
1524
 
                int y = _ty + h - bottomRight.vertical;
1525
 
                int startAngle = 270;
1526
 
                int span = lowerRightBorderStylesMatch ? 90 : 45;
1527
 
 
1528
 
                // Draw the bottom right arc
1529
 
                drawBorderArc(p, x, y, style->borderRightWidth(), style->borderBottomWidth(),
1530
 
                              bottomRight, startAngle, span, bc, style->color(), bs);
1531
 
            }
 
1492
        if (bottomLeft.hasBorderRadius()) {
 
1493
            int x = _tx + bottomLeft.horizontal;
 
1494
            int y = _ty + h - bottomLeft.vertical;
 
1495
            int startAngle = 270;
 
1496
            int span = lowerLeftBorderStylesMatch ? -90 : -45;
 
1497
 
 
1498
            // Draw the bottom left arc
 
1499
            drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderBottomWidth(),
 
1500
                          bottomLeft, startAngle, span, bc, style->color(), bs);
 
1501
        }
 
1502
 
 
1503
        if (bottomRight.hasBorderRadius()) {
 
1504
            int x = _tx + w - bottomRight.horizontal;
 
1505
            int y = _ty + h - bottomRight.vertical;
 
1506
            int startAngle = 270;
 
1507
            int span = lowerRightBorderStylesMatch ? 90 : 45;
 
1508
 
 
1509
            // Draw the bottom right arc
 
1510
            drawBorderArc(p, x, y, style->borderRightWidth(), style->borderBottomWidth(),
 
1511
                          bottomRight, startAngle, span, bc, style->color(), bs);
1532
1512
        }
1533
1513
    }
1534
1514
 
1535
1515
    if(render_l)
1536
1516
    {
1537
 
        bool ignore_top = (renderRadii && topLeft.vertical > 0) ||
 
1517
        bool ignore_top = (topLeft.vertical > 0) ||
1538
1518
          ((tc == lc) && (tt == lt) &&
1539
1519
           (ls >= OUTSET) &&
1540
1520
           (ts == DOTTED || ts == DASHED || ts == SOLID || ts == OUTSET));
1541
1521
 
1542
 
        bool ignore_bottom = (renderRadii && bottomLeft.vertical > 0) ||
 
1522
        bool ignore_bottom = (bottomLeft.vertical > 0) ||
1543
1523
          ((bc == lc) && (bt == lt) &&
1544
1524
           (ls >= OUTSET) &&
1545
1525
           (bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET));
1546
1526
 
1547
 
        int y = _ty;
1548
 
        int y2 = _ty + h;
1549
 
        if (renderRadii) {
1550
 
            y += topLeft.vertical;
1551
 
            y2 -= bottomLeft.vertical;
1552
 
        }
 
1527
        int y = _ty + topLeft.vertical;
 
1528
        int y2 = _ty + h - bottomLeft.vertical;
1553
1529
 
1554
1530
        drawBorder(p, _tx, y, _tx + style->borderLeftWidth(), y2, BSLeft, lc, style->color(), ls,
1555
1531
                   ignore_top?0:style->borderTopWidth(),
1556
1532
                   ignore_bottom?0:style->borderBottomWidth());
1557
1533
 
1558
 
        if (renderRadii && (!upperLeftBorderStylesMatch || !lowerLeftBorderStylesMatch)) {
1559
 
            if (!upperLeftBorderStylesMatch && topLeft.hasBorderRadius()) {
1560
 
                int x = _tx + topLeft.horizontal;
1561
 
                int y = _ty + topLeft.vertical;
1562
 
                int startAngle = 135;
1563
 
                int span = 45;
1564
 
 
1565
 
                // Draw the upper left arc
1566
 
                drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderTopWidth(),
1567
 
                              topLeft, startAngle, span, lc, style->color(), ls);
1568
 
            }
1569
 
            if (!lowerLeftBorderStylesMatch && bottomLeft.hasBorderRadius()) {
1570
 
                int x = _tx + bottomLeft.horizontal;
1571
 
                int y = _ty + h - bottomLeft.vertical;
1572
 
                int startAngle = 180;
1573
 
                int span = 45;
1574
 
 
1575
 
                // Draw the bottom left arc
1576
 
                drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderBottomWidth(),
1577
 
                              bottomLeft, startAngle, span, lc, style->color(), ls);
1578
 
            }
 
1534
        if (!upperLeftBorderStylesMatch && topLeft.hasBorderRadius()) {
 
1535
            int x = _tx + topLeft.horizontal;
 
1536
            int y = _ty + topLeft.vertical;
 
1537
            int startAngle = 135;
 
1538
            int span = 45;
 
1539
 
 
1540
            // Draw the upper left arc
 
1541
            drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderTopWidth(),
 
1542
                          topLeft, startAngle, span, lc, style->color(), ls);
 
1543
        }
 
1544
        if (!lowerLeftBorderStylesMatch && bottomLeft.hasBorderRadius()) {
 
1545
            int x = _tx + bottomLeft.horizontal;
 
1546
            int y = _ty + h - bottomLeft.vertical;
 
1547
            int startAngle = 180;
 
1548
            int span = 45;
 
1549
 
 
1550
            // Draw the bottom left arc
 
1551
            drawBorderArc(p, x, y, style->borderLeftWidth(), style->borderBottomWidth(),
 
1552
                          bottomLeft, startAngle, span, lc, style->color(), ls);
1579
1553
        }
1580
1554
    }
1581
1555
 
1582
1556
    if(render_r)
1583
1557
    {
1584
 
        bool ignore_top = (renderRadii && topRight.vertical > 0) ||
 
1558
        bool ignore_top = (topRight.vertical > 0) ||
1585
1559
          ((tc == rc) && (tt == rt) &&
1586
1560
           (rs >= DOTTED || rs == INSET) &&
1587
1561
           (ts == DOTTED || ts == DASHED || ts == SOLID || ts == OUTSET));
1588
1562
 
1589
 
        bool ignore_bottom = (renderRadii && bottomRight.vertical > 0) ||
 
1563
        bool ignore_bottom = (bottomRight.vertical > 0) ||
1590
1564
          ((bc == rc) && (bt == rt) &&
1591
1565
           (rs >= DOTTED || rs == INSET) &&
1592
1566
           (bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET));
1593
1567
 
1594
 
        int y = _ty;
1595
 
        int y2 = _ty + h;
1596
 
        if (renderRadii) {
1597
 
            y += topRight.vertical;
1598
 
            y2 -= bottomRight.vertical;
1599
 
        }
 
1568
        int y = _ty + topRight.vertical;
 
1569
        int y2 = _ty + h - bottomRight.vertical;
1600
1570
 
1601
1571
        drawBorder(p, _tx + w - style->borderRightWidth(), y, _tx + w, y2, BSRight, rc, style->color(), rs,
1602
1572
                   ignore_top?0:style->borderTopWidth(),
1603
1573
                   ignore_bottom?0:style->borderBottomWidth());
1604
1574
 
1605
 
        if (renderRadii && (!upperRightBorderStylesMatch || !lowerRightBorderStylesMatch)) {
1606
 
            if (!upperRightBorderStylesMatch && topRight.hasBorderRadius()) {
1607
 
                int x = _tx + w - topRight.horizontal;
1608
 
                int y = _ty + topRight.vertical;
1609
 
                int startAngle = 0;
1610
 
                int span = 45;
1611
 
 
1612
 
                // Draw the upper right arc
1613
 
                drawBorderArc(p, x, y, style->borderRightWidth(), style->borderTopWidth(),
1614
 
                              topRight, startAngle, span, rc, style->color(), rs);
1615
 
            }
1616
 
            if (!lowerRightBorderStylesMatch && bottomRight.hasBorderRadius()) {
1617
 
                int x = _tx + w - bottomRight.horizontal;
1618
 
                int y = _ty + h - bottomRight.vertical;
1619
 
                int startAngle = 315;
1620
 
                int span = 45;
1621
 
 
1622
 
                // Draw the bottom right arc
1623
 
                drawBorderArc(p, x, y, style->borderRightWidth(), style->borderBottomWidth(),
1624
 
                              bottomRight, startAngle, span, rc, style->color(), rs);
1625
 
            }
 
1575
        if (!upperRightBorderStylesMatch && topRight.hasBorderRadius()) {
 
1576
            int x = _tx + w - topRight.horizontal;
 
1577
            int y = _ty + topRight.vertical;
 
1578
            int startAngle = 0;
 
1579
            int span = 45;
 
1580
 
 
1581
            // Draw the upper right arc
 
1582
            drawBorderArc(p, x, y, style->borderRightWidth(), style->borderTopWidth(),
 
1583
                          topRight, startAngle, span, rc, style->color(), rs);
 
1584
        }
 
1585
        if (!lowerRightBorderStylesMatch && bottomRight.hasBorderRadius()) {
 
1586
            int x = _tx + w - bottomRight.horizontal;
 
1587
            int y = _ty + h - bottomRight.vertical;
 
1588
            int startAngle = 315;
 
1589
            int span = 45;
 
1590
 
 
1591
            // Draw the bottom right arc
 
1592
            drawBorderArc(p, x, y, style->borderRightWidth(), style->borderBottomWidth(),
 
1593
                          bottomRight, startAngle, span, rc, style->color(), rs);
1626
1594
        }
1627
1595
    }
1628
1596
}