Ejemplo n.º 1
0
/*================================
	SetSelection
=================================*/
void PTPaintSelection::SetSelection( PTPaintSelection *inSource )
{
	if ( inSource->IsEmpty() )
	{
		this->SelectNone();
		return;
	}
	
	try
	{
		this->DisposeBuffer();
		
		SUOffscreen 		*sourceBuffer = inSource->mSelectionBuffer;
		
		mSelectionBuffer = sourceBuffer->CreateSimilarOffscreen( false );
		mSelectionBuffer->CopyFrom( sourceBuffer );
		
		this->SetRawSelection( inSource->GetRegion() );
	}
	catch( ... )
	{
		this->SelectNone();		// if an error occurs, force no selection or things get weird
		throw;
	}
}