本文整理汇总了C++中nuiRect::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ nuiRect::Set方法的具体用法?C++ nuiRect::Set怎么用?C++ nuiRect::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nuiRect
的用法示例。
在下文中一共展示了nuiRect::Set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GlobalToClientRect
void nuiDecoration::GlobalToClientRect(nuiRect& rRect, const nuiWidget* pWidget) const
{
nuiRect clientRect = GetIdealClientRect(pWidget);
// nuiSize bordertop = GetBorder(nuiTop, pWidget);
// nuiSize borderleft = GetBorder(nuiLeft, pWidget);
nuiSize borderright = GetBorder(nuiRight, pWidget);
nuiSize borderbottom = GetBorder(nuiBottom, pWidget);
float X1 = (float)clientRect.Left();
float X2 = (float)clientRect.Right();
float X3 = (float)clientRect.Right()+borderright;
float Y1 = (float)clientRect.Top();
float Y2 = (float)clientRect.Bottom();
float Y3 = (float)clientRect.Bottom()+borderbottom;
const float x0 = (float)rRect.Left();
const float x1 = x0 + X1;
const float x3 = (float)rRect.Right();
const float x2 = x3 - (X3 - X2);
const float y0 = (float)rRect.Top();
const float y1 = y0 + Y1;
const float y3 = (float)rRect.Bottom();
const float y2 = y3 - (Y3 - Y2);
rRect.Set(x1, y1, x2, y2, false);
}
示例2: TextureToImageCoord
void nuiTexture::TextureToImageCoord(nuiRect& rRect) const
{
nuiSize x, y, xx, yy;
x = rRect.Left();
y = rRect.Top();
xx = rRect.Right();
yy = rRect.Bottom();
TextureToImageCoord(x, y);
TextureToImageCoord(xx, yy);
rRect.Set(x, y, xx, yy, false);
}
示例3: ClientToGlobalRect
void nuiDecoration::ClientToGlobalRect(nuiRect& rRect, const nuiWidget* pWidget) const
{
nuiSize bordertop = GetBorder(nuiTop, pWidget);
nuiSize borderleft = GetBorder(nuiLeft, pWidget);
nuiSize borderright = GetBorder(nuiRight, pWidget);
nuiSize borderbottom = GetBorder(nuiBottom, pWidget);
rRect.Set(rRect.Left() - borderleft,
rRect.Top() - bordertop,
rRect.Right() + borderright,
rRect.Bottom() + borderbottom,
false);
}
示例4: GetClipRect
bool nuiPainter::GetClipRect(nuiRect& rRect, bool LocalRect) const
{
if (mClip.mEnabled)
{
rRect = mClip;
}
else
{
rRect.Set(0, 0, mWidth, mHeight);
}
if (LocalRect)
{
// Transform the rect with the inverse of the current matrix
nglMatrixf m(GetMatrix());
m.InvertHomogenous();
nglVectorf v1(rRect.Left(), rRect.Top(), 0, 1);
nglVectorf v2(rRect.Right(), rRect.Bottom(), 0, 1);
v1 = m * v1;
v2 = m * v2;
rRect.Set(v1[0], v1[1], v2[0], v2[1], false);
}
return mClip.mEnabled;
}