Remove Constraints from Cluster,ToolBar,View & ImageView
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / internal / controls / image-view / masked-image-view-impl.cpp
index c534d4d..fad0ade 100644 (file)
@@ -1,24 +1,29 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/controls/image-view/masked-image-view-impl.h>
 
 // EXTERNAL INCLUDES
 #include <sstream>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/image-view/masked-image-view-impl.h>
+#include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/shader-effects/shader-effect.h>
 
 namespace Dali
 {
@@ -350,7 +355,7 @@ void MaskedImageView::OnPropertySet( Property::Index index, Property::Value prop
   }
 }
 
-void MaskedImageView::OnPan(Actor source, PanGesture gesture)
+void MaskedImageView::OnPan(Actor source, const PanGesture& gesture)
 {
   // Used to flag whether edit mode is setting properties
   mSelfPropertySetting = true;
@@ -375,7 +380,7 @@ void MaskedImageView::OnPan(Actor source, PanGesture gesture)
   mSelfPropertySetting = false;
 }
 
-void MaskedImageView::OnPinch(Actor actor, PinchGesture pinch)
+void MaskedImageView::OnPinch(Actor actor, const PinchGesture& pinch)
 {
   // Used to flag whether edit mode is setting properties
   mSelfPropertySetting = true;
@@ -529,7 +534,6 @@ void MaskedImageView::Initialize( unsigned int targetWidth,
   // Create actor to display result of off-screen rendering
   mDestinationImageActor = ImageActor::New( mDestinationImage );
   self.Add( mDestinationImageActor );
-  mDestinationImageActor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
   mDestinationImageActor.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
 
   // Start the masking operation
@@ -628,6 +632,11 @@ MaskedImageView::~MaskedImageView()
   }
 }
 
+void MaskedImageView::OnControlSizeSet( const Vector3& targetSize )
+{
+  mDestinationImageActor.SetSize(targetSize);
+}
+
 void MaskedImageView::OnRenderTaskFinished( Dali::RenderTask& renderTask )
 {
   Toolkit::MaskedImageView handle( GetOwner() );