OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
4 * reserved. | 4 * reserved. |
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 includeLogicalLeftEdge, includeLogicalRightEdge); | 1483 includeLogicalLeftEdge, includeLogicalRightEdge); |
1484 } | 1484 } |
1485 | 1485 |
1486 FloatRoundedRect ComputedStyle::getRoundedInnerBorderFor( | 1486 FloatRoundedRect ComputedStyle::getRoundedInnerBorderFor( |
1487 const LayoutRect& borderRect, | 1487 const LayoutRect& borderRect, |
1488 const LayoutRectOutsets& insets, | 1488 const LayoutRectOutsets& insets, |
1489 bool includeLogicalLeftEdge, | 1489 bool includeLogicalLeftEdge, |
1490 bool includeLogicalRightEdge) const { | 1490 bool includeLogicalRightEdge) const { |
1491 LayoutRect innerRect(borderRect); | 1491 LayoutRect innerRect(borderRect); |
1492 innerRect.expand(insets); | 1492 innerRect.expand(insets); |
1493 innerRect.size().clampNegativeToZero(); | 1493 LayoutSize innerRectSize = innerRect.size(); |
| 1494 innerRectSize.clampNegativeToZero(); |
| 1495 innerRect.setSize(innerRectSize); |
1494 | 1496 |
1495 FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect)); | 1497 FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect)); |
1496 | 1498 |
1497 if (hasBorderRadius()) { | 1499 if (hasBorderRadius()) { |
1498 FloatRoundedRect::Radii radii = getRoundedBorderFor(borderRect).getRadii(); | 1500 FloatRoundedRect::Radii radii = getRoundedBorderFor(borderRect).getRadii(); |
1499 // Insets use negative values. | 1501 // Insets use negative values. |
1500 radii.shrink(-insets.top().toFloat(), -insets.bottom().toFloat(), | 1502 radii.shrink(-insets.top().toFloat(), -insets.bottom().toFloat(), |
1501 -insets.left().toFloat(), -insets.right().toFloat()); | 1503 -insets.left().toFloat(), -insets.right().toFloat()); |
1502 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), | 1504 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), |
1503 includeLogicalLeftEdge, | 1505 includeLogicalLeftEdge, |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2475 if (value < 0) | 2477 if (value < 0) |
2476 fvalue -= 0.5f; | 2478 fvalue -= 0.5f; |
2477 else | 2479 else |
2478 fvalue += 0.5f; | 2480 fvalue += 0.5f; |
2479 } | 2481 } |
2480 | 2482 |
2481 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2483 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
2482 } | 2484 } |
2483 | 2485 |
2484 } // namespace blink | 2486 } // namespace blink |
OLD | NEW |