本文整理汇总了C++中Rect::Inflated方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::Inflated方法的具体用法?C++ Rect::Inflated怎么用?C++ Rect::Inflated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect::Inflated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StatePerformed
void MapBG::StatePerformed(dword state, const String& param)
{
if (_currLevel < 0 || _currLevel >= _levels.GetCount())
return;
MipMapLevel& level = _levels[_currLevel];
Rect pageRect = GetPageRect();
if (_recalc || !_virtPage.Contains(GetPageRect()))
{
_virtPage = pageRect.Inflated(level.GetBlockSize() * _cachePageInitSize);
_recalc = true;
}
Rect currVirtualPage = _virtPage.Inflated(level.GetBlockSize() * _cachePageSize);
if (!_recalc)
return;
for (int i = 0; i < level.GetMipMaps().GetCount(); ++i)
{
Point pi = level.GetMipMaps().GetKey(i);
Rect itemRect(pi, level.GetBlockSize());
if (!level.GetMipMaps()[i])
continue;
if (currVirtualPage.Intersects(itemRect))
{
level.GetMipMaps()[i]->Prepare(
AppendFileName(_mapDir, NFormat("%d-%d-%d.png", _currLevel, pi.x, pi.y)),
level.GetBlockSize()
);
}
else
level.GetMipMaps()[i]->Release();
}
_recalc = false;
}
示例2: CtrlPaint
void Ctrl::CtrlPaint(SystemDraw& w, const Rect& clip) {
GuiLock __;
LEVELCHECK(w, this);
LTIMING("CtrlPaint");
Rect rect = GetRect().GetSize();
Rect orect = rect.Inflated(overpaint);
if(!IsShown() || orect.IsEmpty() || clip.IsEmpty() || !clip.Intersects(orect))
return;
Ctrl *q;
Rect view = rect;
for(int i = 0; i < frame.GetCount(); i++) {
LEVELCHECK(w, NULL);
frame[i].frame->FramePaint(w, view);
view = frame[i].view;
}
Rect oview = view.Inflated(overpaint);
bool hasviewctrls = false;
bool viewexcluded = false;
for(q = firstchild; q; q = q->next)
if(q->IsShown())
if(q->InFrame()) {
if(!viewexcluded && IsTransparent() && q->GetRect().Intersects(view)) {
w.Begin();
w.ExcludeClip(view);
viewexcluded = true;
}
LEVELCHECK(w, q);
Point off = q->GetRect().TopLeft();
w.Offset(off);
q->CtrlPaint(w, clip - off);
w.End();
}
else
hasviewctrls = true;
if(viewexcluded)
w.End();
DOLEVELCHECK;
if(!oview.IsEmpty()) {
if(oview.Intersects(clip) && w.IsPainting(oview)) {
LEVELCHECK(w, this);
if(overpaint) {
w.Clip(oview);
w.Offset(view.left, view.top);
Paint(w);
PaintCaret(w);
w.End();
w.End();
}
else {
w.Clipoff(view);
Paint(w);
PaintCaret(w);
w.End();
}
}
}
if(hasviewctrls && !view.IsEmpty()) {
Rect cl = clip & view;
w.Clip(cl);
for(q = firstchild; q; q = q->next)
if(q->IsShown() && q->InView()) {
LEVELCHECK(w, q);
Rect qr = q->GetRect();
Point off = qr.TopLeft() + view.TopLeft();
Rect ocl = cl - off;
if(ocl.Intersects(Rect(qr.GetSize()).Inflated(overpaint))) {
w.Offset(off);
q->CtrlPaint(w, cl - off);
w.End();
}
}
w.End();
}
}
示例3: CtrlPaint
void Ctrl::CtrlPaint(SystemDraw& w, const Rect& clip) {
GuiLock __;
LEVELCHECK(w, this);
LTIMING("CtrlPaint");
Rect rect = GetRect().GetSize();
Rect orect = rect.Inflated(overpaint);
if(!IsShown() || orect.IsEmpty() || clip.IsEmpty() || !clip.Intersects(orect))
return;
w.PushContext();
//glPushMatrix();
ApplyTransform(TS_BEFORE_CTRL_PAINT);
Ctrl *q;
Rect view = rect;
for(int i = 0; i < frame.GetCount(); i++) {
LEVELCHECK(w, NULL);
frame[i].frame->FramePaint(w, view);
view = frame[i].view;
}
Rect oview = view.Inflated(overpaint);
bool hasviewctrls = false;
bool viewexcluded = false;
for(q = firstchild; q; q = q->next)
if(q->IsShown())
if(q->InFrame()) {
if(!viewexcluded && IsTransparent() && q->GetRect().Intersects(view)) {
w.Begin();
w.ExcludeClip(view);
viewexcluded = true;
}
LEVELCHECK(w, q);
Point off = q->GetRect().TopLeft();
w.Offset(off);
q->CtrlPaint(w, clip - off);
w.End();
}
else
hasviewctrls = true;
if(viewexcluded)
w.End();
//DOLEVELCHECK;
if(!oview.IsEmpty() && oview.Intersects(clip)) {
LEVELCHECK(w, this);
if(cliptobounds)
w.Clip(overpaint ? oview : view);
w.Offset(view.left, view.top);
Paint(w);
PaintCaret(w);
w.End();
if(hasviewctrls && !view.IsEmpty()) {
Rect cl = clip & view;
for(q = firstchild; q; q = q->next)
if(q->IsShown() && q->InView()) {
Rect rr(q->popup ? clip : cl);
LEVELCHECK(w, q);
Rect qr = q->GetRect();
Point off = qr.TopLeft() + view.TopLeft();
Rect ocl = cl - off;
if(ocl.Intersects(Rect(qr.GetSize()).Inflated(overpaint))) {
w.Offset(off);
q->CtrlPaint(w, rr - off);
w.End();
}
}
}
if(cliptobounds)
w.End();
}
ApplyTransform(TS_AFTER_CTRL_PAINT);
//glPopMatrix();
w.PopContext();
}