summaryrefslogtreecommitdiff
path: root/indra/newview/lltooldraganddrop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r--indra/newview/lltooldraganddrop.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 3e5ce427a8..6910b8eced 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -57,6 +57,7 @@
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llworld.h"
+#include "llclipboard.h"
// syntactic sugar
#define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember))
@@ -802,7 +803,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info)
LLViewerObject* hit_obj = pick_info.getObject();
LLSelectMgr::getInstance()->unhighlightAll();
-
+ bool highlight_object = false;
// Treat attachments as part of the avatar they are attached to.
if (hit_obj != NULL)
{
@@ -844,16 +845,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info)
{
target = DT_OBJECT;
hit_face = pick_info.mObjectFace;
- // if any item being dragged will be applied to the object under our cursor
- // highlight that object
- for (S32 i = 0; i < (S32)mCargoIDs.size(); i++)
- {
- if (mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL))
- {
- LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj);
- break;
- }
- }
+ highlight_object = true;
}
}
else if (pick_info.mPickType == LLPickInfo::PICK_LAND)
@@ -899,6 +891,19 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info)
}
}
+ if (highlight_object && mLastAccept > ACCEPT_NO_LOCKED)
+ {
+ // if any item being dragged will be applied to the object under our cursor
+ // highlight that object
+ for (S32 i = 0; i < (S32)mCargoIDs.size(); i++)
+ {
+ if (mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL))
+ {
+ LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj);
+ break;
+ }
+ }
+ }
ECursorType cursor = acceptanceToCursor( mLastAccept );
gViewerWindow->getWindow()->setCursor( cursor );
@@ -2495,6 +2500,10 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory(
item = (LLViewerInventoryItem*)preview->getDragItem();
}
}
+ else if(mSource == SOURCE_VIEWER)
+ {
+ item = (LLViewerInventoryItem*)gClipboard.getSourceObject();
+ }
if(item) return item;
if(cat) return cat;
return NULL;