X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fmagnifier%2Fmagnifier-impl.cpp;h=478c14bcc98883a0db4d49609d52cadfc8bb4f7f;hp=56806e8d6deba77322d360718bca49be0899f2a9;hb=b1e8521ad77e7b4e62b59613b2edef64429130e9;hpb=709f6618b60d366c84e259564c53b6ef0c43b717 diff --git a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp index 56806e8..478c14b 100644 --- a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp +++ b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -21,9 +21,8 @@ // EXTERNAL INCLUDES #include #include -#include +#include #include -#include #include #include #include @@ -31,6 +30,8 @@ // INTERNAL INCLUDES #include #include +#include +#include namespace Dali { @@ -170,7 +171,7 @@ void Magnifier::Initialize() // and what is not. mSourceActor = Actor::New(); Stage().GetCurrent().Add(mSourceActor); - mSourceActor.SetParentOrigin(ParentOrigin::CENTER); + mSourceActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER ); Constraint constraint = Constraint::New( mSourceActor, Actor::Property::POSITION, EqualToConstraint() ); constraint.AddSource( Source( self, Toolkit::Magnifier::Property::SOURCE_POSITION ) ); constraint.Apply(); @@ -257,11 +258,11 @@ void Magnifier::SetFrameVisibility(bool visible) Actor self(Self()); mFrame = Actor::New( ); - mFrame.SetInheritPosition(false); - mFrame.SetInheritScale(true); + mFrame.SetProperty( Actor::Property::INHERIT_POSITION, false ); + mFrame.SetProperty( Actor::Property::INHERIT_SCALE, true ); mFrame.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f); - mFrame.SetSizeModeFactor( sizeOffset ); + mFrame.SetProperty( Actor::Property::SIZE_MODE_FACTOR, sizeOffset ); Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get(); @@ -270,7 +271,7 @@ void Magnifier::SetFrameVisibility(bool visible) map[ Toolkit::BorderVisual::Property::COLOR ] = Color::WHITE; map[ Toolkit::BorderVisual::Property::SIZE ] = IMAGE_BORDER_INDENT; Toolkit::Visual::Base borderVisual = visualFactory.CreateVisual( map ); - borderVisual.SetOnStage( mFrame ); + Toolkit::GetImplementation(borderVisual).SetOnScene( mFrame ); Constraint constraint = Constraint::New( mFrame, Actor::Property::POSITION, EqualToConstraint() ); constraint.AddSource( ParentSource( Actor::Property::WORLD_POSITION ) ); @@ -286,8 +287,6 @@ void Magnifier::SetFrameVisibility(bool visible) void Magnifier::OnSizeSet(const Vector3& targetSize) { - Control::OnSizeSet( targetSize ); - // TODO: Once Camera/CameraActor properties function as proper animatable properties // this code can disappear. // whenever the size of the magnifier changes, the field of view needs to change @@ -295,6 +294,8 @@ void Magnifier::OnSizeSet(const Vector3& targetSize) // a constraint yet as Camera/CameraActor properties are not animatable/constrainable. mActorSize = targetSize; Update(); + + Control::OnSizeSet( targetSize ); } float Magnifier::GetMagnificationFactor() const @@ -315,7 +316,7 @@ void Magnifier::Update() // should be updated when: // Magnifier's world size/scale changes. Actor self(Self()); - Vector3 worldSize = mActorSize * self.GetCurrentWorldScale(); + Vector3 worldSize = mActorSize * self.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ); // Adjust field of view to scale content