From: Eunki, Hong Date: Fri, 30 Sep 2022 12:39:50 +0000 (+0900) Subject: Apply ProjectionDirection property when SceneView size changed X-Git-Tag: dali_2.1.44~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78869efa88096737ed9dd2e0940f180d3804664e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Apply ProjectionDirection property when SceneView size changed SceneView's internal calculation need to be changed if camera's whether projection direction is VERTICAL or HORIZONTAL. Change-Id: I270ddaa0ab3e052155bed2871b42ebfdfa1d32ac Signed-off-by: Eunki, Hong --- diff --git a/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp b/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp index 2f3fbf3230..593daf0775 100644 --- a/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp +++ b/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp @@ -374,12 +374,19 @@ void SceneView::UpdateRenderTask() Vector3 size = Self().GetProperty(Dali::Actor::Property::SIZE); const float aspectRatio = size.width / size.height; mSelectedCamera.SetAspectRatio(aspectRatio); - const float halfHeight = mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE]; - const float halfWidth = aspectRatio * halfHeight; + const bool projectionVertical = mSelectedCamera.GetProperty(Dali::DevelCameraActor::Property::PROJECTION_DIRECTION) == Dali::DevelCameraActor::VERTICAL; + + // if projectionVertical, Top / Bottom is +-ve to keep consistency with orthographic values + // else, Left / Right is +-ve to keep consistency with orthographic values + const float orthographicSize = DALI_LIKELY(projectionVertical) ? mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE] : mSelectedCamera[Dali::CameraActor::Property::RIGHT_PLANE_DISTANCE]; + const float halfHeight = DALI_LIKELY(projectionVertical) ? orthographicSize : orthographicSize / aspectRatio; + const float halfWidth = DALI_LIKELY(projectionVertical) ? orthographicSize * aspectRatio : orthographicSize; + mSelectedCamera[Dali::CameraActor::Property::LEFT_PLANE_DISTANCE] = -halfWidth; mSelectedCamera[Dali::CameraActor::Property::RIGHT_PLANE_DISTANCE] = halfWidth; - mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE] = halfHeight; // Top is +ve to keep consistency with orthographic values - mSelectedCamera[Dali::CameraActor::Property::BOTTOM_PLANE_DISTANCE] = -halfHeight; // Bottom is -ve to keep consistency with orthographic values + mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE] = halfHeight; + mSelectedCamera[Dali::CameraActor::Property::BOTTOM_PLANE_DISTANCE] = -halfHeight; + if(mUseFrameBuffer) { Dali::FrameBuffer currentFrameBuffer = mRenderTask.GetFrameBuffer();