Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / image-view / image-view-impl.cpp
index 8bfa80d..20869d3 100755 (executable)
@@ -207,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 )
@@ -302,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;