if( actor )
{
- // TEMP: Assume all script created actors are not using size negotiation for now
- actor.SetRelayoutEnabled( false );
-
// add children of all the styles
if( OptionalChild actors = IsChild( node, KEYNAME_ACTORS ) )
{
GaussianBlurView::GaussianBlurView( const unsigned int numSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat,
const float downsampleWidthScale, const float downsampleHeightScale,
bool blurUserImage)
- : Control( CONTROL_BEHAVIOUR_NONE )
+ : Control( NO_SIZE_NEGOTIATION )
, mNumSamples(numSamples)
, mBlurBellCurveWidth( 0.001f )
, mPixelFormat(renderTargetPixelFormat)
// Create an ImageActor for performing a horizontal blur on the texture
mImageActorHorizBlur = ImageActor::New();
+ mImageActorHorizBlur.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
mImageActorHorizBlur.SetParentOrigin(ParentOrigin::CENTER);
mImageActorHorizBlur.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
mImageActorHorizBlur.SetShaderEffect( mHorizBlurShader );
// Create an ImageActor for performing a vertical blur on the texture
mImageActorVertBlur = ImageActor::New();
+ mImageActorVertBlur.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
mImageActorVertBlur.SetParentOrigin(ParentOrigin::CENTER);
mImageActorVertBlur.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
mImageActorVertBlur.SetShaderEffect( mVertBlurShader );
if(!mBlurUserImage)
{
mImageActorComposite = ImageActor::New();
+ mImageActorComposite.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
mImageActorComposite.SetParentOrigin(ParentOrigin::CENTER);
mImageActorComposite.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
mImageActorComposite.SetOpacity(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value
// Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
mTargetActor = ImageActor::New();
+ mTargetActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
mTargetActor.SetParentOrigin(ParentOrigin::CENTER);
mTargetActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
for(unsigned int i=0; i<=mBlurLevels;i++)
{
mImageActors[i] = ImageActor::New( );
+ mImageActors[i].SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
mImageActors[i].SetParentOrigin( ParentOrigin::CENTER );
mImageActors[i].SetZ(-static_cast<float>(i)*0.01f);
mImageActors[i].SetColorMode( USE_OWN_MULTIPLY_PARENT_ALPHA );
}
}
-void SuperBlurView::OnRelayout( const Vector2& size, RelayoutContainer& container )
-{
- unsigned int numChildren = Self().GetChildCount();
-
- for( unsigned int i=0; i<numChildren; ++i )
- {
- Self().GetChildAt(i).SetSize(size);
- }
-}
-
void SuperBlurView::OnControlSizeSet( const Vector3& targetSize )
{
if( mTargetSize != Vector2(targetSize) )
*/
virtual void OnControlSizeSet(const Vector3& targetSize);
- /**
- * @copydoc Control::OnRelayout()
- */
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
-
private:
/**
{
Dali::Toolkit::Internal::TableView::CellData data = array[i][j];
char actor = ' ';
+ std::string actorName;
if( data.actor )
{
actor = 'A';
+ actorName = data.actor.GetName();
}
- TV_LOG("Array[%d,%d]=%c %d,%d,%d,%d ", i, j, actor,
+ TV_LOG("Array[%d,%d]=%c %s %d,%d,%d,%d ", i, j, actor, actorName.c_str(),
data.position.rowIndex, data.position.columnIndex,
data.position.rowSpan, data.position.columnSpan );
}
// adopt the child
Self().Add( child );
- // put the actor to the main cell
- CellData& data = mCellData[ position.rowIndex ][ position.columnIndex ];
- data.actor = child;
- data.position = position;
-
// if child spans multiple rows of columns
- bool spanned = false;
- if( position.rowSpan > 1 )
+ if( ( position.rowSpan > 1 ) && ( position.rowIndex + position.rowSpan > mCellData.GetRows() ) )
{
- // span might go outside table
- if( position.rowIndex + position.rowSpan > mCellData.GetRows() )
- {
- // increase table size for the full span, only increasing rows
- ResizeContainers( position.rowIndex + position.rowSpan, mCellData.GetColumns() );
- }
-
- spanned = true;
+ // increase table size for the full span, only increasing rows
+ ResizeContainers( position.rowIndex + position.rowSpan, mCellData.GetColumns() );
}
- if( position.columnSpan > 1 )
+ if( ( position.columnSpan > 1 ) && ( position.columnIndex + position.columnSpan > mCellData.GetColumns() ) )
{
- // span might go outside table
- if( position.columnIndex + position.columnSpan > mCellData.GetColumns() )
- {
- // increase table size for the full span, only increasing columns
- ResizeContainers( mCellData.GetRows(), position.columnIndex + position.columnSpan );
- }
-
- spanned = true;
+ // increase table size for the full span, only increasing columns
+ ResizeContainers( mCellData.GetRows(), position.columnIndex + position.columnSpan );
}
- // if it spanned multiple rows, put the cellinfo in all of those
- if( spanned )
+ // Fill in all cells that need the data
+ CellData data;
+ data.actor = child;
+ data.position = position;
+
+ for( unsigned int row = position.rowIndex; row < ( position.rowIndex + position.rowSpan ); ++row )
{
- for( unsigned int row = position.rowIndex; row < ( position.rowIndex + position.rowSpan ); ++row )
+ // store same information to all cells, this way we can identify
+ // if a cell is the prime location of an actor or a spanned one
+ for( unsigned int column = position.columnIndex; column < ( position.columnIndex + position.columnSpan ); ++column )
{
// store same information to all cells, this way we can identify
// if a cell is the prime location of an actor or a spanned one
- for( unsigned int column = position.columnIndex; column < ( position.columnIndex + position.columnSpan ); ++column )
- {
- // store same information to all cells, this way we can identify
- // if a cell is the prime location of an actor or a spanned one
- mCellData[ row ][ column ] = data;
- }
+ mCellData[ row ][ column ] = data;
}
}
// Accumulate the width
for( unsigned int i = 0; i < position.columnSpan; ++i )
{
+ DALI_ASSERT_DEBUG( column + i < mColumnData.Size() );
cellSize += mColumnData[ column + i ].size;
}
// Accumulate the height
for( unsigned int i = 0; i < position.rowSpan; ++i )
{
+ DALI_ASSERT_DEBUG( row + i < mRowData.Size() );
cellSize += mRowData[ row + i ].size;
}
}
backgroundImage.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
- backgroundImage.SetRelayoutEnabled( false ); // We will scale its size manually
+ backgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backgroundImage.SetSizeScalePolicy( FILL_WITH_ASPECT_RATIO );
mBackgroundLayer.Add( backgroundImage );
RelayoutRequest();
}
}
-void View::OnRelayout( const Vector2& size, RelayoutContainer& container )
-{
- if( mBackgroundLayer )
- {
- if( mBackgroundLayer && mBackgroundLayer.GetChildCount() > 0 )
- {
- Actor background = mBackgroundLayer.GetChildAt(0);
- background.SetScale( FillXYKeepAspectRatio( Vector3( size.width, size.height, 1.0f ), background.GetTargetSize() ) );
- }
- }
-}
-
View::Orientation View::DegreeToViewOrientation( Degree degree )
{
View::Orientation orientation = PORTRAIT;
*/
virtual void OnInitialize();
- /**
- * @copydoc Toolkit::Control::OnRelayout()
- */
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
-
private: