}
}
-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 )
// 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;