本文整理汇总了C++中FloatRoundedRect::isRounded方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatRoundedRect::isRounded方法的具体用法?C++ FloatRoundedRect::isRounded怎么用?C++ FloatRoundedRect::isRounded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatRoundedRect
的用法示例。
在下文中一共展示了FloatRoundedRect::isRounded方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FloatRoundedRect
TEST(FloatRoundedRectTest, zeroRadii)
{
FloatRoundedRect r = FloatRoundedRect(1, 2, 3, 4);
EXPECT_EQ(FloatRect(1, 2, 3, 4), r.rect());
EXPECT_EQ(FloatSize(), r.radii().topLeft());
EXPECT_EQ(FloatSize(), r.radii().topRight());
EXPECT_EQ(FloatSize(), r.radii().bottomLeft());
EXPECT_EQ(FloatSize(), r.radii().bottomRight());
EXPECT_TRUE(r.radii().isZero());
EXPECT_FALSE(r.isRounded());
EXPECT_FALSE(r.isEmpty());
EXPECT_EQ(FloatRect(1, 2, 0, 0), r.topLeftCorner());
EXPECT_EQ(FloatRect(4, 2, 0, 0), r.topRightCorner());
EXPECT_EQ(FloatRect(4, 6, 0, 0), r.bottomRightCorner());
EXPECT_EQ(FloatRect(1, 6, 0, 0), r.bottomLeftCorner());
TEST_INTERCEPTS(r, 2, r.rect().x(), r.rect().maxX());
TEST_INTERCEPTS(r, 4, r.rect().x(), r.rect().maxX());
TEST_INTERCEPTS(r, 6, r.rect().x(), r.rect().maxX());
float minXIntercept;
float maxXIntercept;
EXPECT_FALSE(r.xInterceptsAtY(1, minXIntercept, maxXIntercept));
EXPECT_FALSE(r.xInterceptsAtY(7, minXIntercept, maxXIntercept));
// The FloatRoundedRect::expandRadii() function doesn't change radii FloatSizes that
// are <= zero. Same as RoundedRect::expandRadii().
r.expandRadii(20);
r.shrinkRadii(10);
EXPECT_TRUE(r.radii().isZero());
}
示例2: fillRoundedRect
void GraphicsContext::fillRoundedRect(const FloatRoundedRect& rect, const Color& color, BlendMode blendMode)
{
if (rect.isRounded()) {
setCompositeOperation(compositeOperation(), blendMode);
platformFillRoundedRect(rect, color);
setCompositeOperation(compositeOperation());
} else
fillRect(rect.rect(), color, compositeOperation(), blendMode);
}
示例3: clipOutRoundedRect
void GraphicsContext::clipOutRoundedRect(const FloatRoundedRect& rect)
{
if (paintingDisabled())
return;
if (!rect.isRounded()) {
clipOut(rect.rect());
return;
}
Path path;
path.addRoundedRect(rect);
clipOut(path);
}
示例4: fillRoundedRect
void GraphicsContext::fillRoundedRect(const FloatRoundedRect& rect, const Color& color, BlendMode blendMode)
{
if (paintingDisabled())
return;
if (isRecording()) {
m_displayListRecorder->fillRoundedRect(rect, color, blendMode);
return;
}
if (rect.isRounded()) {
setCompositeOperation(compositeOperation(), blendMode);
platformFillRoundedRect(rect, color);
setCompositeOperation(compositeOperation());
} else
fillRect(rect.rect(), color, compositeOperation(), blendMode);
}