Changed button to use ImageView instead of ImageActor and enabled custom fragment...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / image-view / image-view-impl.cpp
index e47d1cd..714701a 100644 (file)
@@ -92,22 +92,26 @@ void ImageView::SetImage( Property::Map map )
   Actor self = Self();
   Toolkit::RendererFactory::Get().ResetRenderer( mRenderer, self, mPropertyMap );
 
-  int width = 0;
   Property::Value* widthValue = mPropertyMap.Find( "width" );
   if( widthValue )
   {
-    widthValue->Get( width );
+    int width;
+    if( widthValue->Get( width ) )
+    {
+      mImageSize = ImageDimensions( width, mImageSize.GetHeight() );
+    }
   }
 
-  int height = 0;
   Property::Value* heightValue = mPropertyMap.Find( "height" );
   if( heightValue )
   {
-    heightValue->Get( height );
+    int height;
+    if( heightValue->Get( height ) )
+    {
+      mImageSize = ImageDimensions( mImageSize.GetWidth(), height );
+    }
   }
 
-  mImageSize = ImageDimensions( width, height );
-
   RelayoutRequest();
 }
 
@@ -138,6 +142,11 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
   }
 }
 
+void ImageView::SetDepthIndex( int depthIndex )
+{
+  mRenderer.SetDepthIndex( depthIndex );
+}
+
 Vector3 ImageView::GetNaturalSize()
 {
   Vector3 size;