#include "IntRect.h"
#include <algorithm>
+using namespace std;
+
namespace WebCore {
bool RoundedIntRect::Radii::isZero() const
void RoundedIntRect::Radii::expand(int topWidth, int bottomWidth, int leftWidth, int rightWidth)
{
- m_topLeft.setWidth(std::max(0, m_topLeft.width() + leftWidth));
- m_topLeft.setHeight(std::max(0, m_topLeft.height() + topWidth));
+ m_topLeft.setWidth(max(0, m_topLeft.width() + leftWidth));
+ m_topLeft.setHeight(max(0, m_topLeft.height() + topWidth));
- m_topRight.setWidth(std::max(0, m_topRight.width() + rightWidth));
- m_topRight.setHeight(std::max(0, m_topRight.height() + topWidth));
+ m_topRight.setWidth(max(0, m_topRight.width() + rightWidth));
+ m_topRight.setHeight(max(0, m_topRight.height() + topWidth));
- m_bottomLeft.setWidth(std::max(0, m_bottomLeft.width() + leftWidth));
- m_bottomLeft.setHeight(std::max(0, m_bottomLeft.height() + bottomWidth));
+ m_bottomLeft.setWidth(max(0, m_bottomLeft.width() + leftWidth));
+ m_bottomLeft.setHeight(max(0, m_bottomLeft.height() + bottomWidth));
- m_bottomRight.setWidth(std::max(0, m_bottomRight.width() + rightWidth));
- m_bottomRight.setHeight(std::max(0, m_bottomRight.height() + bottomWidth));
+ m_bottomRight.setWidth(max(0, m_bottomRight.width() + rightWidth));
+ m_bottomRight.setHeight(max(0, m_bottomRight.height() + bottomWidth));
}
void RoundedIntRect::Radii::includeLogicalEdges(const RoundedIntRect::Radii& edges, bool isHorizontal, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
m_radii.excludeLogicalEdges(isHorizontal, excludeLogicalLeftEdge, excludeLogicalRightEdge);
}
+bool RoundedIntRect::isRenderable() const
+{
+ return m_radii.topLeft().width() + m_radii.topRight().width() <= m_rect.width()
+ && m_radii.bottomLeft().width() + m_radii.bottomRight().width() <= m_rect.width()
+ && m_radii.topLeft().height() + m_radii.topRight().height() <= m_rect.height()
+ && m_radii.bottomLeft().height() + m_radii.bottomRight().height() <= m_rect.height();
+}
+
} // namespace WebCore