本文整理汇总了C++中FloatRect::maxXMaxYCorner方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatRect::maxXMaxYCorner方法的具体用法?C++ FloatRect::maxXMaxYCorner怎么用?C++ FloatRect::maxXMaxYCorner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatRect
的用法示例。
在下文中一共展示了FloatRect::maxXMaxYCorner方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enclosingLayoutRect
LayoutRect enclosingLayoutRect(const FloatRect& rect)
{
LayoutPoint location = flooredLayoutPoint(rect.minXMinYCorner());
LayoutPoint maxPoint = ceiledLayoutPoint(rect.maxXMaxYCorner());
return LayoutRect(location, maxPoint - location);
}
示例2: overlapsRect
bool VertexPair::overlapsRect(const FloatRect& rect) const
{
bool boundsOverlap = (minX() < rect.maxX()) && (maxX() > rect.x()) && (minY() < rect.maxY()) && (maxY() > rect.y());
if (!boundsOverlap)
return false;
float leftSideValues[4] = {
leftSide(vertex1(), vertex2(), rect.minXMinYCorner()),
leftSide(vertex1(), vertex2(), rect.maxXMinYCorner()),
leftSide(vertex1(), vertex2(), rect.minXMaxYCorner()),
leftSide(vertex1(), vertex2(), rect.maxXMaxYCorner())
};
int currentLeftSideSign = 0;
for (unsigned i = 0; i < 4; ++i) {
if (!leftSideValues[i])
continue;
int leftSideSign = leftSideValues[i] > 0 ? 1 : -1;
if (!currentLeftSideSign)
currentLeftSideSign = leftSideSign;
else if (currentLeftSideSign != leftSideSign)
return true;
}
return false;
}
示例3: enclosingIntRect
IntRect enclosingIntRect(const FloatRect& rect)
{
IntPoint location = flooredIntPoint(rect.minXMinYCorner());
IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner());
return IntRect(location, maxPoint - location);
}
示例4: enclosedIntRect
IntRect enclosedIntRect(const FloatRect& rect) {
IntPoint location = ceiledIntPoint(rect.minXMinYCorner());
IntPoint maxPoint = flooredIntPoint(rect.maxXMaxYCorner());
IntSize size = maxPoint - location;
size.clampNegativeToZero();
return IntRect(location, size);
}
示例5: enclosingLayoutRect
LayoutRect enclosingLayoutRect(const FloatRect& rect)
{
#if ENABLE(SUBPIXEL_LAYOUT)
LayoutPoint location = flooredLayoutPoint(rect.minXMinYCorner());
LayoutPoint maxPoint = ceiledLayoutPoint(rect.maxXMaxYCorner());
return LayoutRect(location, maxPoint - location);
#else
return enclosingIntRect(rect);
#endif
}
示例6: drawRepaintIndicator
void PlatformCALayer::drawRepaintIndicator(CGContextRef context, PlatformCALayer* platformCALayer, int repaintCount, CGColorRef customBackgroundColor)
{
char text[16]; // that's a lot of repaints
snprintf(text, sizeof(text), "%d", repaintCount);
FloatRect indicatorBox = platformCALayer->bounds();\
indicatorBox.setLocation( { 1, 1 } );
indicatorBox.setSize(FloatSize(12 + 10 * strlen(text), 27));
CGContextStateSaver stateSaver(context);
CGContextSetAlpha(context, 0.5f);
CGContextBeginTransparencyLayerWithRect(context, indicatorBox, 0);
if (customBackgroundColor)
CGContextSetFillColorWithColor(context, customBackgroundColor);
else
CGContextSetRGBFillColor(context, 0, 0.5f, 0.25f, 1);
if (platformCALayer->isOpaque())
CGContextFillRect(context, indicatorBox);
else {
Path boundsPath;
boundsPath.moveTo(indicatorBox.maxXMinYCorner());
boundsPath.addLineTo(indicatorBox.maxXMaxYCorner());
boundsPath.addLineTo(indicatorBox.minXMaxYCorner());
const float cornerChunk = 8;
boundsPath.addLineTo(FloatPoint(indicatorBox.x(), indicatorBox.y() + cornerChunk));
boundsPath.addLineTo(FloatPoint(indicatorBox.x() + cornerChunk, indicatorBox.y()));
boundsPath.closeSubpath();
CGContextAddPath(context, boundsPath.platformPath());
CGContextFillPath(context);
}
if (platformCALayer->owner()->isUsingDisplayListDrawing(platformCALayer)) {
CGContextSetRGBStrokeColor(context, 0, 0, 0, 0.65);
CGContextSetLineWidth(context, 2);
CGContextStrokeRect(context, indicatorBox);
}
if (platformCALayer->acceleratesDrawing())
CGContextSetRGBFillColor(context, 1, 0, 0, 1);
else
CGContextSetRGBFillColor(context, 1, 1, 1, 1);
platformCALayer->drawTextAtPoint(context, indicatorBox.x() + 5, indicatorBox.y() + 22, CGSizeMake(1, -1), 22, text, strlen(text));
CGContextEndTransparencyLayer(context);
}
示例7: Polygon
static FloatPointGraph::Polygon edgesForRect(FloatRect rect, FloatPointGraph& graph)
{
auto minMin = graph.findOrCreateNode(rect.minXMinYCorner());
auto minMax = graph.findOrCreateNode(rect.minXMaxYCorner());
auto maxMax = graph.findOrCreateNode(rect.maxXMaxYCorner());
auto maxMin = graph.findOrCreateNode(rect.maxXMinYCorner());
return FloatPointGraph::Polygon({
std::make_pair(minMin, maxMin),
std::make_pair(maxMin, maxMax),
std::make_pair(maxMax, minMax),
std::make_pair(minMax, minMin)
});
}
示例8: encloseRectToDevicePixels
FloatRect encloseRectToDevicePixels(const FloatRect& rect, float deviceScaleFactor)
{
FloatPoint location = floorPointToDevicePixels(rect.minXMinYCorner(), deviceScaleFactor);
FloatPoint maxPoint = ceilPointToDevicePixels(rect.maxXMaxYCorner(), deviceScaleFactor);
return FloatRect(location, maxPoint - location);
}