Previously mVisual was only updated after OnRelayout but this is too late,
RelayoutRequest triggers GetNaturalSize before OnRelayout, GetNaturalSize needs mVisual to be the updated visual not the previous.
Change-Id: Ib0e46af88774d866a5f6074e43437f0b173bf0f6
mPropertyMap = map;
mUrl.clear();
mImage.Reset();
+ mRelayoutRequired = true;
+
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
// Don't set mVisual until it is ready and shown. Getters will still use current visual.
if (!mVisual)
mUrl = url;
mImage.Reset();
mPropertyMap.Clear();
+ mRelayoutRequired = true;
// Don't set mVisual until it is ready and shown. Getters will still use current visual.
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, size );
void ImageView::OnResourceReady( Toolkit::Control control )
{
+ // Visual ready so update visual attached to this ImageView, following call to RelayoutRequest will use this visual.
+ mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+
if( mRelayoutRequired)
{
mRelayoutRequired = false;