From 565a38ba364f7b4ae0bdb4a74c23be41b117c3df Mon Sep 17 00:00:00 2001 From: seungho Date: Tue, 6 Sep 2022 16:25:59 +0900 Subject: [PATCH] [Tizen] To do not reset camera properties when OnScene Change-Id: I205318ffe549f343fbb898dd481b54f25761cba7 Signed-off-by: seungho --- dali/internal/event/actors/camera-actor-impl.cpp | 28 ++++++++---------------- dali/internal/event/actors/camera-actor-impl.h | 1 + 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/dali/internal/event/actors/camera-actor-impl.cpp b/dali/internal/event/actors/camera-actor-impl.cpp index d69462a..3e2c899 100644 --- a/dali/internal/event/actors/camera-actor-impl.cpp +++ b/dali/internal/event/actors/camera-actor-impl.cpp @@ -47,7 +47,7 @@ namespace // clang-format off DALI_PROPERTY_TABLE_BEGIN DALI_PROPERTY( "type", STRING, true, false, true, Dali::CameraActor::Property::TYPE ) -DALI_PROPERTY( "projectionMode", STRING, true, false, true, Dali::CameraActor::Property::PROJECTION_MODE ) +DALI_PROPERTY( "projectionMode", INTEGER, true, false, true, Dali::CameraActor::Property::PROJECTION_MODE ) DALI_PROPERTY( "fieldOfView", FLOAT, true, false, true, Dali::CameraActor::Property::FIELD_OF_VIEW ) DALI_PROPERTY( "aspectRatio", FLOAT, true, false, true, Dali::CameraActor::Property::ASPECT_RATIO ) DALI_PROPERTY( "nearPlaneDistance", FLOAT, true, false, true, Dali::CameraActor::Property::NEAR_PLANE_DISTANCE ) @@ -199,7 +199,7 @@ void CameraActor::OnSceneConnectionInternal() { // If the canvas size has not been set, then use the size of the scene to which we've been added // in order to set up the current projection - if((mCanvasSize.width < Math::MACHINE_EPSILON_1000) || (mCanvasSize.height < Math::MACHINE_EPSILON_1000)) + if(!mPropertyChanged && ((mCanvasSize.width < Math::MACHINE_EPSILON_1000) || (mCanvasSize.height < Math::MACHINE_EPSILON_1000))) { if(mProjectionMode == Dali::Camera::ORTHOGRAPHIC_PROJECTION) { @@ -287,6 +287,10 @@ void CameraActor::SetAspectRatio(float aspectRatio) { if(!Equals(aspectRatio, mAspectRatio)) { + { + // This will be removed after CameraActor refactoring. + mPropertyChanged = true; + } mAspectRatio = aspectRatio; // sceneObject is being used in a separate thread; queue a message to set @@ -588,15 +592,8 @@ void CameraActor::SetDefaultProperty(Property::Index index, const Property::Valu } case Dali::CameraActor::Property::PROJECTION_MODE: { - std::string s(propertyValue.Get()); - if(s == "PERSPECTIVE_PROJECTION") - { - SetProjectionMode(Dali::Camera::PERSPECTIVE_PROJECTION); - } - else if(s == "ORTHOGRAPHIC_PROJECTION") - { - SetProjectionMode(Dali::Camera::ORTHOGRAPHIC_PROJECTION); - } + Dali::Camera::ProjectionMode projectionMode = Dali::Camera::ProjectionMode(propertyValue.Get()); + SetProjectionMode(projectionMode); break; } case Dali::CameraActor::Property::FIELD_OF_VIEW: @@ -700,14 +697,7 @@ Property::Value CameraActor::GetDefaultProperty(Property::Index index) const } case Dali::CameraActor::Property::PROJECTION_MODE: { - if(Dali::Camera::PERSPECTIVE_PROJECTION == mProjectionMode) - { - ret = "PERSPECTIVE_PROJECTION"; - } - else if(Dali::Camera::ORTHOGRAPHIC_PROJECTION == mProjectionMode) - { - ret = "ORTHOGRAPHIC_PROJECTION"; - } + ret = mProjectionMode; break; } case Dali::CameraActor::Property::FIELD_OF_VIEW: diff --git a/dali/internal/event/actors/camera-actor-impl.h b/dali/internal/event/actors/camera-actor-impl.h index 6d0bb17..fe012da 100644 --- a/dali/internal/event/actors/camera-actor-impl.h +++ b/dali/internal/event/actors/camera-actor-impl.h @@ -267,6 +267,7 @@ private: // Data float mTopClippingPlane; float mBottomClippingPlane; bool mInvertYAxis; + bool mPropertyChanged{false}; // This variable will be removed after CameraActor refactoring. }; } // namespace Internal -- 2.7.4