本文整理汇总了C++中ZRect::Top方法的典型用法代码示例。如果您正苦于以下问题:C++ ZRect::Top方法的具体用法?C++ ZRect::Top怎么用?C++ ZRect::Top使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZRect
的用法示例。
在下文中一共展示了ZRect::Top方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyFrom
void ZDCCanvas_X_NonWindow::CopyFrom(ZDCState& ioState, const ZPoint& inDestLocation, ZRef<ZDCCanvas> inSourceCanvas, const ZDCState& inSourceState, const ZRect& inSourceRect)
{
ZRef<ZDCCanvas_X> sourceCanvasX = ZRefDynamicCast<ZDCCanvas_X>(inSourceCanvas);
ZAssertStop(kDebug_X, sourceCanvasX != nil);
if (!fDrawable || !sourceCanvasX->Internal_GetDrawable())
return;
SetupLock theSetupLock(this);
// We can (currently) only copy from one drawable to another if they're on the same display
// ZAssertStop(kDebug_X, fXServer == sourceCanvasX->fXServer);
ZRect destRect = inSourceRect + (ioState.fOrigin + inDestLocation - inSourceRect.TopLeft());
ZRect sourceRect = inSourceRect + inSourceState.fOrigin;
ZDCRgn realClip = this->Internal_CalcClipRgn(ioState);
fXServer->SetRegion(fGC, realClip.GetRegion());
++fChangeCount_Clip;
fXServer->SetFunction(fGC, GXcopy);
++fChangeCount_Mode;
fXServer->CopyArea(sourceCanvasX->Internal_GetDrawable(), fDrawable, fGC,
sourceRect.Left(), sourceRect.Top(),
sourceRect.Width(), sourceRect.Height(),
destRect.Left(), destRect.Top());
}
示例2: Scroll
void ZDCCanvas_X_NonWindow::Scroll(ZDCState& ioState, const ZRect& inRect, ZCoord hDelta, ZCoord vDelta)
{
if (!fDrawable)
return;
SetupLock theSetupLock(this);
++fChangeCount_Clip;
ZPoint offset(hDelta, vDelta);
// destRgn is the pixels we want and are able to draw to.
ZDCRgn destRgn = ((ioState.fClip + ioState.fClipOrigin) & (inRect + ioState.fOrigin));
// srcRgn is the set of pixels we're want and are able to copy from.
ZDCRgn srcRgn = ((destRgn - offset) & (inRect + ioState.fOrigin));
// drawnRgn is the destination pixels that will be drawn by the CopyBits call, it's the srcRgn
// shifted back to the destination.
ZDCRgn drawnRgn = srcRgn + offset;
// invalidRgn is the destination pixels we wanted to draw but could not because they were
// outside the visRgn, or were in the excludeRgn
ZDCRgn invalidRgn = destRgn - drawnRgn;
// And set the clip (drawnRgn)
fXServer->SetRegion(fGC, drawnRgn.GetRegion());
++fChangeCount_Clip;
fXServer->SetFunction(fGC, GXcopy);
++fChangeCount_Mode;
ZRect drawnBounds = drawnRgn.Bounds();
fXServer->CopyArea(fDrawable, fDrawable, fGC,
drawnBounds.Left() - offset.h, drawnBounds.Top() - offset.v,
drawnBounds.Width(), drawnBounds.Height(),
drawnBounds.Left(), drawnBounds.Top());
}
示例3: Contains
bool ZRect::Contains(const ZRect &rect) const
{
//contains all 4 points
return Contains(rect.Left(),rect.Top()) && Contains(rect.Right(),rect.Top()) &&
Contains(rect.Left(),rect.Bottom()) && Contains(rect.Right(),rect.Bottom());
}
示例4: Intersects
bool ZRect::Intersects(const ZRect &rect) const
{
return !(rX > rect.Right() || rect.Left() > rX+rWidth ||
rY > rect.Bottom() || rect.Top() > rY+rHeight);
}