本文整理汇总了C++中FloatRect::minXMinYCorner方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatRect::minXMinYCorner方法的具体用法?C++ FloatRect::minXMinYCorner怎么用?C++ FloatRect::minXMinYCorner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatRect
的用法示例。
在下文中一共展示了FloatRect::minXMinYCorner方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enclosingIntRect
IntRect enclosingIntRect(const FloatRect& rect)
{
IntPoint location = flooredIntPoint(rect.minXMinYCorner());
IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner());
return IntRect(location, maxPoint - location);
}
示例2: enclosingLayoutRect
LayoutRect enclosingLayoutRect(const FloatRect& rect)
{
LayoutPoint location = flooredLayoutPoint(rect.minXMinYCorner());
LayoutPoint maxPoint = ceiledLayoutPoint(rect.maxXMaxYCorner());
return LayoutRect(location, maxPoint - location);
}
示例3: 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;
}
示例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: 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)
});
}
示例7: 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);
}