Commit 2cae846d16036e641287295af0c8557abd5b9617

Authored by Adeel Kazmi
2 parents a2cfdf76 20f49784

[dali_1.1.4] Merge branch 'devel/master'

Change-Id: I7f47ab256aadbcae617e5e4cf5d871ec1a2f669c
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
@@ -463,6 +463,7 @@ public: @@ -463,6 +463,7 @@ public:
463 image.SetSize( imageSize ); 463 image.SetSize( imageSize );
464 image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage ); 464 image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
465 mFittingModes[image.GetId()] = fittingMode; 465 mFittingModes[image.GetId()] = fittingMode;
  466 + mResourceUrls[image.GetId()] = imageSource.configuration.path;
466 mSizes[image.GetId()] = imageSize; 467 mSizes[image.GetId()] = imageSize;
467 468
468 gridActor.Add( image ); 469 gridActor.Add( image );
@@ -493,10 +494,13 @@ public: @@ -493,10 +494,13 @@ public:
493 Dali::FittingMode::Type newMode = NextMode( mFittingModes[id] ); 494 Dali::FittingMode::Type newMode = NextMode( mFittingModes[id] );
494 const Vector2 imageSize = mSizes[actor.GetId()]; 495 const Vector2 imageSize = mSizes[actor.GetId()];
495 496
  497 + const std::string& url = mResourceUrls[id];
  498 + Image newImage = CreateImage( url, imageSize.width + 0.5f, imageSize.height + 0.5f, newMode );
496 ImageView imageView = ImageView::DownCast( actor ); 499 ImageView imageView = ImageView::DownCast( actor );
497 - Image oldImage = imageView.GetImage();  
498 - Image newImage = CreateImage( ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode );  
499 - imageView.SetImage( newImage ); 500 + if(imageView)
  501 + {
  502 + imageView.SetImage( newImage );
  503 + }
500 mFittingModes[id] = newMode; 504 mFittingModes[id] = newMode;
501 } 505 }
502 } 506 }
@@ -597,6 +601,7 @@ private: @@ -597,6 +601,7 @@ private:
597 ScrollBar mScrollBarHorizontal; 601 ScrollBar mScrollBarHorizontal;
598 bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary) 602 bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary)
599 std::map<unsigned, Dali::FittingMode::Type> mFittingModes; ///< Stores the current scaling mode of each image, keyed by image actor id. 603 std::map<unsigned, Dali::FittingMode::Type> mFittingModes; ///< Stores the current scaling mode of each image, keyed by image actor id.
  604 + std::map<unsigned, std::string> mResourceUrls; ///< Stores the url of each image, keyed by image actor id.
600 std::map<unsigned, Vector2> mSizes; ///< Stores the current size of each image, keyed by image actor id. 605 std::map<unsigned, Vector2> mSizes; ///< Stores the current size of each image, keyed by image actor id.
601 }; 606 };
602 607
packaging/com.samsung.dali-demo.spec
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 Name: com.samsung.dali-demo 3 Name: com.samsung.dali-demo
4 Summary: The OpenGLES Canvas Core Demo 4 Summary: The OpenGLES Canvas Core Demo
5 -Version: 1.1.3 5 +Version: 1.1.4
6 Release: 1 6 Release: 1
7 Group: System/Libraries 7 Group: System/Libraries
8 License: Apache-2.0 8 License: Apache-2.0