Пример #1
0
void ZDCCanvas_X::FrameRect(ZDCState& ioState, const ZRect& inRect)
	{
	if (!fDrawable)
		return;
	if (!ioState.fInk)
		return;
	if (ioState.fPenWidth <= 0)
		return;
	if (inRect.IsEmpty())
		return;

	if (ioState.fPenWidth == 1)
		{
		SetupLock theSetupLock(this);
		SetupClip theSetupClip(this, ioState);
		if (theSetupClip.IsEmpty())
			return;
		SetupInk theSetupInk(this, ioState);
		ZRect realRect = inRect + ioState.fOrigin;
		fXServer->DrawRectangle(fDrawable, fGC, inRect.left + ioState.fOrigin.h, inRect.top + ioState.fOrigin.v, inRect.Width() - 1, inRect.Height() - 1);
		}
	else
		{
		this->Line(ioState, inRect.left, inRect.top, inRect.right - ioState.fPenWidth, inRect.top);
		this->Line(ioState, inRect.right - ioState.fPenWidth, inRect.top, inRect.right - ioState.fPenWidth, inRect.bottom - ioState.fPenWidth);
		this->Line(ioState, inRect.right - ioState.fPenWidth, inRect.bottom - ioState.fPenWidth, inRect.left, inRect.bottom - ioState.fPenWidth);
		this->Line(ioState, inRect.left, inRect.bottom - ioState.fPenWidth, inRect.left, inRect.top);
		}
	}
Пример #2
0
void ZDCCanvas_X::InvertRoundRect(ZDCState& ioState, const ZRect& inRect, const ZPoint& inCornerSize)
	{
	if (!fDrawable)
		return;
	if (inRect.IsEmpty())
		return;

	this->InvertRegion(ioState, ZDCRgn::sRoundRect(inRect, inCornerSize));
	}
Пример #3
0
void ZDCCanvas_X::FrameRoundRect(ZDCState& ioState, const ZRect& inRect, const ZPoint& inCornerSize)
	{
	if (!fDrawable)
		return;
	if (!ioState.fInk)
		return;
	if (ioState.fPenWidth <= 0)
		return;
	if (inRect.IsEmpty())
		return;

	this->FrameRegion(ioState, ZDCRgn::sRoundRect(inRect, inCornerSize));
	}
Пример #4
0
void ZDCCanvas_X::InvertEllipse(ZDCState& ioState, const ZRect& inBounds)
	{
	if (!fDrawable)
		return;
	if (inBounds.IsEmpty())
		return;

	SetupLock theSetupLock(this);
	SetupClip theSetupClip(this, ioState);
	if (theSetupClip.IsEmpty())
		return;

	fXServer->SetFunction(fGC, GXinvert);
	++fChangeCount_Mode;

	fXServer->FillArc(fDrawable, fGC, inBounds.left + ioState.fOrigin.h, inBounds.top + ioState.fOrigin.v, inBounds.Width(), inBounds.Height(), 0, 360*64);
	}
Пример #5
0
void ZDCCanvas_X::InvertRect(ZDCState& ioState, const ZRect& inRect)
	{
	if (!fDrawable)
		return;
	if (inRect.IsEmpty())
		return;

	SetupLock theSetupLock(this);
	SetupClip theSetupClip(this, ioState);
	if (theSetupClip.IsEmpty())
		return;

	fXServer->SetFunction(fGC, GXinvert);
	++fChangeCount_Mode;

	fXServer->FillRectangle(fDrawable, fGC, inRect.left + ioState.fOrigin.h, inRect.top + ioState.fOrigin.v, inRect.Width(), inRect.Height());
	}
Пример #6
0
void ZDCCanvas_X::FillEllipse(ZDCState& ioState, const ZRect& inBounds)
	{
	if (!fDrawable)
		return;
	if (!ioState.fInk)
		return;
	if (inBounds.IsEmpty())
		return;

	SetupLock theSetupLock(this);
	SetupClip theSetupClip(this, ioState);
	if (theSetupClip.IsEmpty())
		return;

	SetupInk theSetupInk(this, ioState);

	fXServer->FillArc(fDrawable, fGC, inBounds.left + ioState.fOrigin.h, inBounds.top + ioState.fOrigin.v, inBounds.Width(), inBounds.Height(), 0, 360*64);
	}
Пример #7
0
void ZDCCanvas_X::FillRect(ZDCState& ioState, const ZRect& inRect)
	{
	if (!fDrawable)
		return;
	if (!ioState.fInk)
		return;
	if (inRect.IsEmpty())
		return;

	SetupLock theSetupLock(this);
	SetupClip theSetupClip(this, ioState);
	if (theSetupClip.IsEmpty())
		return;

	SetupInk theSetupInk(this, ioState);

	fXServer->FillRectangle(fDrawable, fGC, inRect.left + ioState.fOrigin.h, inRect.top + ioState.fOrigin.v, inRect.Width(), inRect.Height());
	}
Пример #8
0
void ZDCCanvas_X::FrameEllipse(ZDCState& ioState, const ZRect& inBounds)
	{
	if (!fDrawable)
		return;
	if (!ioState.fInk)
		return;
	if (ioState.fPenWidth <= 0)
		return;
	if (inBounds.IsEmpty())
		return;

	SetupLock theSetupLock(this);
	SetupClip theSetupClip(this, ioState);
	if (theSetupClip.IsEmpty())
		return;

	SetupInk theSetupInk(this, ioState);
	ZPoint ellipseSize = inBounds.Size();
	ZCoord twicePenWidth = ioState.fPenWidth * 2;
	if (twicePenWidth >= ellipseSize.h || twicePenWidth >= ellipseSize.v)
		{
		fXServer->FillArc(fDrawable, fGC,
			inBounds.left + ioState.fOrigin.h,
			inBounds.top + ioState.fOrigin.v,
			ellipseSize.h,
			ellipseSize.v,
			0, 360*64);
		}
	else
		{
		ZCoord halfPenWidth = ioState.fPenWidth / 2;
		fXServer->DrawArc(fDrawable, fGC,
			inBounds.left + ioState.fOrigin.h + halfPenWidth,
			inBounds.top + ioState.fOrigin.v + halfPenWidth,
			ellipseSize.h - 2 * halfPenWidth,
			ellipseSize.v - 2 * halfPenWidth,
			0, 360 * 64);
		}
	}