本文整理汇总了C++中IntCoord::bottom方法的典型用法代码示例。如果您正苦于以下问题:C++ IntCoord::bottom方法的具体用法?C++ IntCoord::bottom怎么用?C++ IntCoord::bottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntCoord
的用法示例。
在下文中一共展示了IntCoord::bottom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateListPosition
IntCoord ComboBox::calculateListPosition()
{
int length = 0;
if (mFlowDirection.isVertical())
length = mList->getOptimalHeight();
else
length = mMaxListLength;
if (mMaxListLength > 0 && length > mMaxListLength)
length = mMaxListLength;
// берем глобальные координаты выджета
IntCoord coord = getAbsoluteCoord();
// размер леера
IntSize sizeView = mList->getParentSize();
if (mFlowDirection == FlowDirection::TopToBottom)
{
if ((coord.bottom() + length) <= sizeView.height)
coord.top += coord.height;
else
coord.top -= length;
coord.height = length;
}
else if (mFlowDirection == FlowDirection::BottomToTop)
{
if ((coord.top - length) >= 0)
coord.top -= length;
else
coord.top += coord.height;
coord.height = length;
}
else if (mFlowDirection == FlowDirection::LeftToRight)
{
if ((coord.right() + length) <= sizeView.width)
coord.left += coord.width;
else
coord.left -= length;
coord.width = length;
}
else if (mFlowDirection == FlowDirection::RightToLeft)
{
if ((coord.left - length) >= 0)
coord.left -= length;
else
coord.left += coord.width;
coord.width = length;
}
return coord;
}
示例2: cropPolygon
VectorFloatPoint cropPolygon(FloatPoint* _baseVerticiesPos, size_t _size, const IntCoord& _cropRectangle)
{
VectorFloatPoint resultVerticiesPos;
resultVerticiesPos.resize(_size);
for (size_t i = 0; i < _size; ++i)
{
resultVerticiesPos[i] = _baseVerticiesPos[i];
}
cropPolygonSide(resultVerticiesPos, _cropRectangle.left, Left);
cropPolygonSide(resultVerticiesPos, _cropRectangle.right(), Right);
cropPolygonSide(resultVerticiesPos, _cropRectangle.top, Top);
cropPolygonSide(resultVerticiesPos, _cropRectangle.bottom(), Bottom);
return resultVerticiesPos;
}