summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelobject.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-01-12 04:37:42 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-01-12 04:37:42 +0200
commitf9866a3543e1e13404891c949a3ceca482d2f649 (patch)
tree34e170a4bbe0c9c60832821fdf3246c883b6cf53 /indra/newview/llpanelobject.cpp
parenta66ea0a9089f9525a9e92ae3e7ebed412ffd53e1 (diff)
parenta0c3d69c620a92d73a1008f218680fb4d0ef9255 (diff)
Merge branch 'main' into DRTVWR-573-maint-R
# Conflicts: # autobuild.xml # indra/newview/llagent.cpp # indra/newview/llimview.cpp # indra/newview/llimview.h # indra/newview/llinventoryfunctions.cpp # indra/newview/llpanelmediasettingsgeneral.cpp # indra/newview/pipeline.cpp
Diffstat (limited to 'indra/newview/llpanelobject.cpp')
-rw-r--r--indra/newview/llpanelobject.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 0bfc1297d3..bc7933d84b 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -93,6 +93,8 @@ enum {
MI_HOLE_COUNT
};
+const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters
+
//static const std::string LEGACY_FULLBRIGHT_DESC =LLTrans::getString("Fullbright");
BOOL LLPanelObject::postBuild()
@@ -1685,6 +1687,16 @@ void LLPanelObject::sendPosition(BOOL btn_down)
mCtrlPosZ->set(LLWorld::getInstance()->resolveLandHeightAgent(newpos) + 1.f);
}
}
+ else
+ {
+ if (newpos.length() > MAX_ATTACHMENT_DIST)
+ {
+ newpos.clampLength(MAX_ATTACHMENT_DIST);
+ mCtrlPosX->set(newpos.mV[VX]);
+ mCtrlPosY->set(newpos.mV[VY]);
+ mCtrlPosZ->set(newpos.mV[VZ]);
+ }
+ }
// Make sure new position is in a valid region, so the object
// won't get dumped by the simulator.
@@ -2191,6 +2203,10 @@ void LLPanelObject::onPastePos()
mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], 0.f, max_width);
//height will get properly clamped by sendPosition
}
+ else
+ {
+ mClipboardPos.clampLength(MAX_ATTACHMENT_DIST);
+ }
mCtrlPosX->set( mClipboardPos.mV[VX] );
mCtrlPosY->set( mClipboardPos.mV[VY] );