Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / image-view / image-view-impl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 3a9cd53..20869d3
@@ -66,10 +66,6 @@ using namespace Dali;
 ImageView::ImageView()
 : Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) )
 {
-  SetAccessibilityConstructor( []( Dali::Actor actor ) {
-    return std::unique_ptr< Dali::Accessibility::Accessible >(
-        new AccessibleImpl( actor, Dali::Accessibility::Role::Image ) );
-  } );
 }
 
 ImageView::~ImageView()
@@ -211,22 +207,6 @@ void ImageView::SetDepthIndex( int depthIndex )
   }
 }
 
-void ImageView::OnStageConnection( int depth )
-{
-  if( mImage )
-  {
-    mImage.UploadedSignal().Emit( mImage );
-  }
-
-  Dali::ResourceImage resourceImage = Dali::ResourceImage::DownCast( mImage );
-  if( resourceImage )
-  {
-    resourceImage.LoadingFinishedSignal().Emit( resourceImage );
-  }
-
-  Control::OnStageConnection( depth ); // Enabled visuals will be put on stage
-}
-
 Vector3 ImageView::GetNaturalSize()
 {
   if( mVisual )
@@ -306,7 +286,8 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
       // scale to fit the padded area
       auto finalSize =
-             naturalSize * std::min((paddedSize.width / naturalSize.width), (paddedSize.height / naturalSize.height));
+             naturalSize * std::min( ( naturalSize.width  ? ( paddedSize.width  / naturalSize.width  ) : 0 ),
+                                     ( naturalSize.height ? ( paddedSize.height / naturalSize.height ) : 0 ) );
 
       // calculate final offset within the padded area
       auto finalOffset = Vector2(padding.start, padding.top) + (paddedSize - finalSize) * .5f;