本文整理汇总了C++中Box2d::rightBottom方法的典型用法代码示例。如果您正苦于以下问题:C++ Box2d::rightBottom方法的具体用法?C++ Box2d::rightBottom怎么用?C++ Box2d::rightBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box2d
的用法示例。
在下文中一共展示了Box2d::rightBottom方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawRect
bool GiGraphics::drawRect(const GiContext* ctx, const Box2d& rect,
bool modelUnit)
{
Point2d points[4] = {
rect.leftBottom(), rect.rightBottom(),
rect.rightTop(), rect.leftTop()
};
return drawPolygon(ctx, 4, points, modelUnit);
}
示例2: drawRoundRect
bool GiGraphics::drawRoundRect(const GiContext* ctx,
const Box2d& rect, float rx, float ry,
bool modelUnit)
{
if (m_impl->drawRefcnt == 0 || rect.isEmpty())
return false;
GiLock lock (&m_impl->drawRefcnt);
bool ret = false;
if (ry < _MGZERO)
ry = rx;
if (!DRAW_RECT(m_impl, modelUnit).isIntersect(rect)) // 全部在显示区域外
return false;
if (rx < _MGZERO)
{
Point2d points[4] = {
rect.leftBottom(), rect.rightBottom(),
rect.rightTop(), rect.leftTop()
};
return drawPolygon(ctx, 4, points);
}
else
{
Point2d points[16];
mgRoundRectToBeziers(points, rect, rx, ry);
S2D(xf(), modelUnit).TransformPoints(16, points);
ret = rawBeginPath();
if (ret)
{
ret = rawMoveTo(points[0].x, points[0].y);
ret = rawBezierTo(&points[1], 3);
ret = rawLineTo(points[4].x, points[4].y);
ret = rawBezierTo(&points[5], 3);
ret = rawLineTo(points[8].x, points[8].y);
ret = rawBezierTo(&points[9], 3);
ret = rawLineTo(points[12].x, points[12].y);
ret = rawBezierTo(&points[13], 3);
ret = rawClosePath();
ret = rawEndPath(ctx, true);
}
}
return ret;
}
示例3: drawRect
bool GiGraphics::drawRect(const GiContext* ctx, const Box2d& rect,
bool modelUnit)
{
if (rect.isEmpty() && ctx && m_impl->canvas) {
rawRect(ctx, 0, 0, 0, 0);
return false;
}
Point2d points[4] = {
rect.leftBottom(), rect.rightBottom(),
rect.rightTop(), rect.leftTop()
};
return !rect.isEmpty() && drawPolygon(ctx, 4, points, modelUnit);
}
示例4: setRect
void MgBaseRect::setRect(const Box2d& rect, float angle)
{
_points[0] = rect.leftTop();
_points[1] = rect.rightTop();
_points[2] = rect.rightBottom();
_points[3] = rect.leftBottom();
if (!mgIsZero(angle))
{
Matrix2d mat(Matrix2d::rotation(angle, rect.center()));
for (int i = 0; i < 4; i++)
_points[i] *= mat;
}
}
示例5: getRectHandle
void mgnear::getRectHandle(const Box2d& rect, int index, Point2d& pt)
{
switch (index)
{
case 0: pt = rect.leftTop(); break;
case 1: pt = rect.rightTop(); break;
case 2: pt = rect.rightBottom(); break;
case 3: pt = rect.leftBottom(); break;
case 4: pt = Point2d(rect.center().x, rect.ymax); break;
case 5: pt = Point2d(rect.xmax, rect.center().y); break;
case 6: pt = Point2d(rect.center().x, rect.ymin); break;
case 7: pt = Point2d(rect.xmin, rect.center().y); break;
default: pt = rect.center(); break;
}
}
示例6: drawRoundRect
bool GiGraphics::drawRoundRect(const GiContext* ctx,
const Box2d& rect, float rx, float ry,
bool modelUnit)
{
if (rect.isEmpty() || isStopping())
return false;
bool ret = false;
if (ry < _MGZERO)
ry = rx;
if (!DRAW_RECT(m_impl, modelUnit).isIntersect(rect)) // 全部在显示区域外
return false;
if (rx < _MGZERO) {
Point2d points[4] = {
rect.leftBottom(), rect.rightBottom(),
rect.rightTop(), rect.leftTop()
};
return drawPolygon(ctx, 4, points);
} else {
Point2d pxs[16];
mgcurv::roundRectToBeziers(pxs, rect, rx, ry);
S2D(xf(), modelUnit).transformPoints(16, pxs);
ret = rawBeginPath();
if (ret) {
rawMoveTo(pxs[0].x, pxs[0].y);
rawBezierTo(pxs[1].x, pxs[1].y, pxs[2].x, pxs[2].y, pxs[3].x, pxs[3].y);
rawLineTo(pxs[4].x, pxs[4].y);
rawBezierTo(pxs[5].x, pxs[5].y, pxs[6].x, pxs[6].y, pxs[7].x, pxs[7].y);
rawLineTo(pxs[8].x, pxs[8].y);
rawBezierTo(pxs[9].x, pxs[9].y, pxs[10].x, pxs[10].y, pxs[11].x, pxs[11].y);
rawLineTo(pxs[12].x, pxs[12].y);
rawBezierTo(pxs[13].x, pxs[13].y, pxs[14].x, pxs[14].y, pxs[15].x, pxs[15].y);
rawClosePath();
ret = rawEndPath(ctx, true);
}
}
return ret;
}