本文整理汇总了C++中ZRect::TopLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ ZRect::TopLeft方法的具体用法?C++ ZRect::TopLeft怎么用?C++ ZRect::TopLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZRect
的用法示例。
在下文中一共展示了ZRect::TopLeft方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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:
ZDC_Off::ZDC_Off(const ZDC& inOther, bool inForceOffscreen)
: ZDC(inOther)
{
// Initially, we copy all settings from inOther, then we attempt to
// create a new offscreen canvas.
if (inForceOffscreen || !fCanvas->IsOffScreen())
{
ZRect canvasClipRect = this->GetClip().Bounds() + this->GetOrigin();
ZRef<ZDCCanvas> offCanvas;
try
{
// We allow the offscreen creation to fail if inForceOffscreen is false.
offCanvas = fCanvas->CreateOffScreen(canvasClipRect);
}
catch (...)
{
if (inForceOffscreen)
throw;
}
if (offCanvas && offCanvas->IsOffScreen())
{
fCanvas = offCanvas;
this->ZeroChangeCounts();
fState.fOriginComp = canvasClipRect.TopLeft();
this->SetOrigin(inOther.GetOrigin());
this->SetPatternOrigin(inOther.GetPatternOrigin());
this->SetClip(inOther.GetClip());
}
}
}