Set size of a new visual in visual replacement case 94/208494/3
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 25 Jun 2019 07:05:48 +0000 (16:05 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Fri, 5 Jul 2019 01:13:05 +0000 (01:13 +0000)
mVisual is not updated util the resource is ready in the case of visual replacement.
So apply the transform and size to the new visual.

Change-Id: Ied60fd820978d1dcd03fee53b1b105cce750645d

dali-toolkit/internal/controls/image-view/image-view-impl.cpp

index edff0e3..06e823e 100755 (executable)
@@ -349,6 +349,14 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
 
     mVisual.SetTransformAndSize( transformMap, size );
+
+    // mVisual is not updated util the resource is ready in the case of visual replacement.
+    // So apply the transform and size to the new visual.
+    Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+    if( visual && visual != mVisual )
+    {
+      visual.SetTransformAndSize( transformMap, size );
+    }
   }
 }