naturalSize.y = mDesiredSize.GetHeight();
return;
}
+ else if( mImpl->mRenderer ) // Check if we have a loaded image
+ {
+ auto textureSet = mImpl->mRenderer.GetTextures();
+
+ if( textureSet )
+ {
+ auto texture = textureSet.GetTexture(0);
+ naturalSize.x = texture.GetWidth();
+ naturalSize.y = texture.GetHeight();
+ return;
+ }
+ }
- else if( mMaskingData != NULL && mMaskingData->mAlphaMaskUrl.IsValid() &&
+ if( mMaskingData != NULL && mMaskingData->mAlphaMaskUrl.IsValid() &&
mMaskingData->mCropToMask )
{
ImageDimensions dimensions = Dali::GetClosestImageSize( mMaskingData->mAlphaMaskUrl.GetUrl() );
}
return;
}
- else if( mImageUrl.IsValid() && mImageUrl.GetLocation() == VisualUrl::LOCAL )
+ else if( mImageUrl.IsValid() )
{
- ImageDimensions dimensions = Dali::GetClosestImageSize( mImageUrl.GetUrl() );
-
- if( dimensions != ImageDimensions( 0, 0 ) )
- {
- naturalSize.x = dimensions.GetWidth();
- naturalSize.y = dimensions.GetHeight();
- }
- else
+ if( mImageUrl.GetLocation() == VisualUrl::LOCAL )
{
- Image brokenImage = VisualFactoryCache::GetBrokenVisualImage();
+ ImageDimensions dimensions = Dali::GetClosestImageSize( mImageUrl.GetUrl() );
+
+ if( dimensions != ImageDimensions( 0, 0 ) )
+ {
+ naturalSize.x = dimensions.GetWidth();
+ naturalSize.y = dimensions.GetHeight();
+ }
+ else
+ {
+ Image brokenImage = VisualFactoryCache::GetBrokenVisualImage();
- naturalSize.x = brokenImage.GetWidth();
- naturalSize.y = brokenImage.GetWidth();
+ naturalSize.x = brokenImage.GetWidth();
+ naturalSize.y = brokenImage.GetWidth();
+ }
+ return;
}
- return;
}
naturalSize = Vector2::ZERO;