Example #1
0
// ****************************************************************************
//
//  Function Name:	RRotateSelectionTracker::GetFeedbackBoundingRect( )
//
//  Description:		Returns the feedback bounding rect
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
RRealRect RRotateSelectionTracker::GetFeedbackBoundingRect( const RRealPoint& point ) const
	{
	// Get the view transform
	R2dTransform transform;
	m_pView->GetViewTransform( transform, TRUE );

	// Calculate the angle
	YAngle angle = CalcAngle( point );

	// Get the bounding rect, in device units
	RRealRect boundingRect = m_pSelection->GetRotateTrackingFeedbackBoundingRect( transform, m_TrackingRotationCenter, angle );

	// Convert back to logical units
	transform.Invert( );
	boundingRect *= transform;

	// Add the feedback line
	boundingRect.AddPointToRect( point );

	return boundingRect;
	}
Example #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 );
		}
	}