Exemple #1
0
// ****************************************************************************
//
//  Function Name:	RWindowView::InvalidateVectorRect( )
//
//  Description:		Invalidates the given vector rect in this view
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RWindowView::InvalidateVectorRect( const RRealVectorRect& rect, BOOLEAN fErase )
	{
	//
	//	Only invalidate if we have a CWnd
	if( !GetCWnd() )
		return;

		// Get the bounding rect...
	RRealRect temp = rect.m_TransformedBoundingRect;

	// Get our transformation...
	R2dTransform	transform;
	ApplyTransform( transform, FALSE, FALSE );

	// Apply it to our bounds...
	temp *= transform;

	// Convert the bounds to device units
	::LogicalUnitsToDeviceUnits( temp, *this );

	// guard for roundoff...
		const YRealDimension	kRoundOffGuard	= 2.0;
	temp.Inflate( RRealSize( kRoundOffGuard, kRoundOffGuard ) );

	// Put it in a CRect and do the invalidate
	CRect crect( ::Round(temp.m_Left), ::Round(temp.m_Top), ::Round(temp.m_Right), ::Round(temp.m_Bottom) );
	GetCWnd( ).InvalidateRect( crect, fErase );
	}
Exemple #2
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::Invalidate( )
//
//  Description:		Invalidates the region occupied by this selection in the
//							given view.
//
//  Returns:			Nothing
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
void RSingleSelection::Invalidate( BOOLEAN fInvalidateIfLocked ) const
	{
	if( fInvalidateIfLocked || m_pSelectedObject->GetComponentAttributes( ).IsLocked( ) == FALSE )
		{
		// Get the full soft effects bounding rect and invalidate it
		YSelectionBoundingRect boundingRect;
		boundingRect = m_pSelectedObject->GetFullSoftEffectsBoundingRect();
		SelectionRectFromObjectRect( boundingRect, m_pView, TRUE );
		RRealRect invalidRect = boundingRect.m_TransformedBoundingRect;
		
		// Extend the rectangle to contain the rotate handle
		invalidRect.AddPointToRect( GetRotateHandleCenterPoint( ) );
			
		// Inflate by the rotate handle size
		RRealSize rotateHandleSize( kRotateHandleRenderSize + 1, kRotateHandleRenderSize + 1);
		::DeviceUnitsToLogicalUnits( rotateHandleSize, *m_pView );
		invalidRect.Inflate( rotateHandleSize );
		
		// Do the invalidate
		m_pView->InvalidateVectorRect( invalidRect );
		}
	}