summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-03-08 02:10:49 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-03-08 13:16:44 +0200
commit748c0eb50d87a3f8895b25791409ce5e2e4926c4 (patch)
tree9f6280c391373ca6ee90e4d1fe5f0d38119d6288 /indra
parenta865d423974ea06dffa47798c81e98e7570b02ec (diff)
viewer#730 Zoom slider not working in some cases.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llagentcamera.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 87ca8ef366..e6c988fe14 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -749,11 +749,6 @@ F32 LLAgentCamera::getCameraZoomFraction(bool get_third_person)
return mHUDTargetZoom;
}
- if (isDisableCameraConstraints())
- {
- return mCameraZoomFraction;
- }
-
if (get_third_person || (mFocusOnAvatar && cameraThirdPerson()))
{
return clamp_rescale(mCameraZoomFraction, MIN_ZOOM_FRACTION, MAX_ZOOM_FRACTION, 1.f, 0.f);
@@ -767,6 +762,10 @@ F32 LLAgentCamera::getCameraZoomFraction(bool get_third_person)
F32 min_zoom;
F32 max_zoom = getCameraMaxZoomDistance();
+ if (isDisableCameraConstraints())
+ {
+ max_zoom = MAX_CAMERA_DISTANCE_FROM_OBJECT;
+ }
F32 distance = (F32)mCameraFocusOffsetTarget.magVec();
if (mFocusObject.notNull())
@@ -798,10 +797,6 @@ void LLAgentCamera::setCameraZoomFraction(F32 fraction)
{
mHUDTargetZoom = fraction;
}
- else if (isDisableCameraConstraints())
- {
- mCameraZoomFraction = fraction;
- }
else if (mFocusOnAvatar && cameraThirdPerson())
{
mCameraZoomFraction = rescale(fraction, 0.f, 1.f, MAX_ZOOM_FRACTION, MIN_ZOOM_FRACTION);
@@ -816,6 +811,10 @@ void LLAgentCamera::setCameraZoomFraction(F32 fraction)
{
F32 min_zoom = LAND_MIN_ZOOM;
F32 max_zoom = getCameraMaxZoomDistance();
+ if (isDisableCameraConstraints())
+ {
+ max_zoom = MAX_CAMERA_DISTANCE_FROM_OBJECT;
+ }
if (mFocusObject.notNull())
{