本文整理汇总了C++中DRect::getMinY方法的典型用法代码示例。如果您正苦于以下问题:C++ DRect::getMinY方法的具体用法?C++ DRect::getMinY怎么用?C++ DRect::getMinY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DRect
的用法示例。
在下文中一共展示了DRect::getMinY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersectsRect
bool DRect::intersectsRect(const DRect& rect) const
{
return !( getMaxX() < rect.getMinX()
|| rect.getMaxX() < getMinX()
|| getMaxY() < rect.getMinY()
|| rect.getMaxY() < getMinY());
}
示例2: equals
bool DRect::equals(const DRect& rect) const
{
if (fabsf(this->getMinX() - rect.getMinX()) >= 0.01f)
{
return false;
}
if (fabsf(this->getMaxX() - rect.getMaxX()) >= 0.01f)
{
return false;
}
if (fabsf(this->getMinY() - rect.getMinY()) >= 0.01f)
{
return false;
}
if (fabsf(this->getMaxY() - rect.getMaxY()) >= 0.01f)
{
return false;
}
return true;
}
示例3: visit
void CAView::visit()
{
CC_RETURN_IF(!m_bVisible);
kmGLPushMatrix();
this->transform();
bool isScissor = (bool)glIsEnabled(GL_SCISSOR_TEST);
DRect restoreScissorRect = DRectZero;
if (isScissor)
{
GLfloat params[4];
glGetFloatv(GL_SCISSOR_BOX, params);
restoreScissorRect = DRect(params[0], params[1], params[2], params[3]);
}
if (!m_bDisplayRange)
{
kmMat4 modelview;
kmGLGetMatrix(KM_GL_MODELVIEW, &modelview);
kmMat4 tm;
kmMat4Identity(&tm);
tm.mat[12] = m_obContentSize.width;
tm.mat[13] = m_obContentSize.height;
kmMat4 tm2;
kmMat4Multiply(&tm2, &modelview, &tm);
DPoint point = DPoint(modelview.mat[12], modelview.mat[13]);
static CAApplication* application = CAApplication::getApplication();
if (application->getProjection() == CAApplication::P3D)
{
point = ccpAdd(point, application->getWinSize() / 2);
}
DSize size = DSize(tm2.mat[12] - modelview.mat[12], tm2.mat[13] - modelview.mat[13]);
DRect frame = DRect(point.x, point.y, size.width, size.height);
if (isScissor)
{
float x1 = MAX(s_dip_to_px(frame.getMinX()), restoreScissorRect.getMinX());
float y1 = MAX(s_dip_to_px(frame.getMinY()), restoreScissorRect.getMinY());
float x2 = MIN(s_dip_to_px(frame.getMaxX()) + 0.5f, restoreScissorRect.getMaxX());
float y2 = MIN(s_dip_to_px(frame.getMaxY()) + 0.5f, restoreScissorRect.getMaxY());
float width = MAX(x2-x1, 0);
float height = MAX(y2-y1, 0);
glScissor(x1, y1, width, height);
}
else
{
glEnable(GL_SCISSOR_TEST);
glScissor(s_dip_to_px(frame.origin.x),
s_dip_to_px(frame.origin.y),
s_dip_to_px(frame.size.width) + 0.5f,
s_dip_to_px(frame.size.height) + 0.5f);
}
}
this->sortAllSubviews();
CAVector<CAView*>::iterator itr=m_obSubviews.begin();
while (itr!=m_obSubviews.end())
{
CC_BREAK_IF((*itr)->m_nZOrder >= 0);
(*itr)->visit();
itr++;
}
this->draw();
while (itr!=m_obSubviews.end())
{
(*itr)->visit();
itr++;
}
//m_uOrderOfArrival = 0;
if (!m_bDisplayRange)
{
if (isScissor)
{
glScissor(restoreScissorRect.origin.x,
restoreScissorRect.origin.y ,
restoreScissorRect.size.width,
restoreScissorRect.size.height);
}
else
{
glDisable(GL_SCISSOR_TEST);
}
}
kmGLPopMatrix();
}