mRootLayer->Remove( actor );
}
-void Stage::SurfaceResized(float width, float height)
+void Stage::SurfaceResized( float width, float height )
{
- mSurfaceSize.width = width;
- mSurfaceSize.height = height;
-
- // Internally we want to report the actual size of the stage.
- mSize.width = width;
- mSize.height = height - mTopMargin;
+ if( ( fabs( width - mSurfaceSize.width ) > Math::MACHINE_EPSILON_1000 ) || ( fabs( height - mSurfaceSize.height ) > Math::MACHINE_EPSILON_1000 ) )
+ {
+ mSurfaceSize.width = width;
+ mSurfaceSize.height = height;
- // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
- mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
+ // Internally we want to report the actual size of the stage.
+ mSize.width = width;
+ mSize.height = height - mTopMargin;
- // Adjust the camera height to allow for top-margin
- SetDefaultCameraPosition();
+ // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
+ mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
- mRootLayer->SetSize( mSize.width, mSize.height );
+ // Adjust the camera height to allow for top-margin
+ SetDefaultCameraPosition();
- // Repeat for SystemOverlay actors
- if( mSystemOverlay )
- {
- // Note that the SystemOverlay has a separate camera, configured for the full surface-size.
- // This will remain unaffected by changes in SetDefaultCameraPosition()
- mSystemOverlay->GetImpl()->SetSize( width, height );
- }
+ mRootLayer->SetSize( mSize.width, mSize.height );
- SetDefaultSurfaceRectMessage( mUpdateManager, Rect<int>( 0, 0, width, height ) );
+ // Repeat for SystemOverlay actors
+ if( mSystemOverlay )
+ {
+ // Note that the SystemOverlay has a separate camera, configured for the full surface-size.
+ // This will remain unaffected by changes in SetDefaultCameraPosition()
+ mSystemOverlay->GetImpl()->SetSize( width, height );
+ }
- // if single render task to screen then set its viewport parameters
- if( 1 == mRenderTaskList->GetTaskCount() )
- {
- Dali::RenderTask mDefaultRenderTask = mRenderTaskList->GetTask(0);
+ SetDefaultSurfaceRectMessage( mUpdateManager, Rect<int>( 0, 0, width, height ) );
- if(!mDefaultRenderTask.GetTargetFrameBuffer())
+ // if single render task to screen then set its viewport parameters
+ if( 1 == mRenderTaskList->GetTaskCount() )
{
- mDefaultRenderTask.SetViewport( Viewport(0, 0, width, height) );
+ Dali::RenderTask mDefaultRenderTask = mRenderTaskList->GetTask( 0u );
+
+ if(!mDefaultRenderTask.GetTargetFrameBuffer())
+ {
+ mDefaultRenderTask.SetViewport( Viewport(0, 0, width, height) );
+ }
}
}
-
}
Vector2 Stage::GetSize() const