Size negotiation example
[platform/core/uifw/dali-demo.git] / examples / image-scaling-irregular-grid / image-scaling-irregular-grid-example.cpp
index 437194c..6b14053 100644 (file)
@@ -183,6 +183,7 @@ Image CreateImage(const std::string& filename, unsigned int width, unsigned int
 
   attributes.SetSize( width, height );
   attributes.SetScalingMode( scalingMode );
+  attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
   Image image = ResourceImage::New( filename, attributes );
   return image;
 }
@@ -359,6 +360,9 @@ public:
     mContentLayer.Add( mScrollView );
     mScrollView.Add( imageField );
     mGridActor = imageField;
+
+    // Scroll to top of grid so first images loaded are on-screen:
+    mScrollView.ScrollTo( Vector3( 0, -1000000, 0 ) );
   }
 
   /**
@@ -417,7 +421,8 @@ public:
     // coordinates in a frame defined by a parent actor:
 
     Actor gridActor = Actor::New();
-    gridActor.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+    gridActor.SetRelayoutEnabled( true );
+    gridActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
     gridActor.SetParentOrigin( ParentOrigin::CENTER );
     gridActor.SetAnchorPoint( AnchorPoint::CENTER );