示例#1
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::DrawRotateHandle( )
//
//  Description:		Draws the rotation line and handle
//
//  Returns:			Nothing
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
void RSingleSelection::DrawRotateHandle( RDrawingSurface& drawingSurface, const R2dTransform& transform, const RIntRect& ) const
	{
	// Get the bounding rect
	YSelectionBoundingRect boundingRect;
	GetSelectionBoundingRect( boundingRect );

	// Get the center point; this will be one end point of the rotate handle line
	RRealPoint centerPoint = boundingRect.GetCenterPoint( );

	// Get the other end point
	RRealPoint lineEndPoint = GetRotateHandleCenterPoint( );

	// Draw the line
	drawingSurface.MoveTo( centerPoint, transform );
	drawingSurface.LineTo( lineEndPoint, transform );

	// Now draw the rotate handle
	// Convert to device units
	::LogicalUnitsToDeviceUnits( lineEndPoint, *m_pView );

	// Now build the rotate handle, using this point as the middle of the left side
	RRealRect	rotateHandleRect;
	rotateHandleRect.m_Left		= lineEndPoint.m_x - ( kRotateHandleRenderSize / 2 );
	rotateHandleRect.m_Top		= lineEndPoint.m_y - ( kRotateHandleRenderSize / 2 );
	rotateHandleRect.m_Right	= lineEndPoint.m_x + ( kRotateHandleRenderSize / 2 ) + 1;
	rotateHandleRect.m_Bottom	= lineEndPoint.m_y + ( kRotateHandleRenderSize / 2 ) + 1;
	::DeviceUnitsToLogicalUnits( rotateHandleRect, *m_pView );

	// Now draw the rotate handle
	rotateHandleRect *= transform;
	drawingSurface.FillRectangle( rotateHandleRect );
	}
示例#2
0
// ****************************************************************************
//
//  Function Name:	RRotateSelectionTracker::Render( )
//
//  Description:		Called to render the tracker feedback
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RRotateSelectionTracker::Render( RDrawingSurface& drawingSurface, const R2dTransform& transform, const RRealPoint& point ) const
	{
	// Calculate the angle
	YAngle angle = CalcAngle( point );

	// Draw the feedback line
	drawingSurface.MoveTo( m_TrackingRotationCenter, transform );
	drawingSurface.LineTo( point, transform );

	// Render the tracking rectangle
	m_pSelection->DrawRotateTrackingFeedback( drawingSurface, transform, m_TrackingRotationCenter, angle );
	}