예제 #1
0
void CCAttrMap::TransformBrushFills(TransformBase& Trans)
{
	CCRuntimeClass	   *pType;
	void			   *pVal;
	for( iterator Pos = GetStartPosition(); Pos != GetEndPosition(); )
	{
		GetNextAssoc(Pos,pType,pVal);
		if (pVal != NULL)
		{
			NodeAttribute* pNodeAttr = (NodeAttribute *)pVal;
			
			// check that we are not about to set line width to zero
			if( pNodeAttr->IsALineWidthAttr() && Trans.TransLines != FALSE )
			{
				INT32 Test = labs( INT32(Trans.GetScalar().MakeDouble() * ((AttrLineWidth*)pNodeAttr)->Value.LineWidth) );		
				if (Test <= 10)
					Trans.TransLines = FALSE;
			}

			if (!pNodeAttr->NeedsToRenderAtEachBrushStroke())
				pNodeAttr->Transform(Trans);
		}
	}


}
예제 #2
0
void CCAttrMap::TransformForBrush(TransformBase& Trans)
{
	CCRuntimeClass	   *pType;
	void			   *pVal;
	for( iterator Pos = GetStartPosition(); Pos != GetEndPosition(); )
	{
		GetNextAssoc(Pos,pType,pVal);
		if (pVal != NULL)
		{
			NodeAttribute* pNodeAttr = (NodeAttribute *)pVal;
			
			// check that we are not about to set line width to zero
			if( pNodeAttr->IsALineWidthAttr() && Trans.TransLines != FALSE )
			{
				double Test =  Trans.GetScalar().MakeDouble() * (double)((AttrLineWidth*)pNodeAttr)->Value.LineWidth;
		//		TRACEUSER( "Diccon", _T("Scale line width by %f\n"), Test);
				if (Test <= 1.0)
				{
				//	TRACEUSER( "Diccon", _T("Setting line width scaling OFF\n"));
					Trans.TransLines = FALSE;
				}
			}

			if (pNodeAttr->NeedsToRenderAtEachBrushStroke())
				pNodeAttr->Transform(Trans);
		}
	}
}