summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2009-11-25 09:52:20 -0800
committerRick Pasetto <rick@lindenlab.com>2009-11-25 09:52:20 -0800
commit97af20b4ba4a400569e99a616fc026190d3eec6c (patch)
treedfcff5f485f0d76418e823d4f4bef6adf000d5d7
parent0b9aa795702ae9304b2e9d4c58698f95ac636399 (diff)
Change drag highlighting to use LLSelectMgr::{un}highlightObjectOnly() instead of gPipeline.setHighlightObject().
The latter seems a little buggy.
-rw-r--r--indra/newview/llviewerwindow.cpp14
-rw-r--r--indra/newview/llviewerwindow.h1
2 files changed, 11 insertions, 4 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 17b9490f63..cc74c1fbe2 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -833,7 +833,7 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas
llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl;
LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject()));
- gPipeline.setHighlightObject(NULL);
+
if (obj && obj->permModify())
{
LLTextureEntry *te = obj->getTE(object_face);
@@ -858,19 +858,25 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas
// just navigate to the URL
obj->getMediaImpl(object_face)->navigateTo(url);
}
+ LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);
+ mDragHoveredObject = NULL;
}
else {
mDragHoveredObject = obj;
- // Make the object glow
- gPipeline.setHighlightObject(mDragHoveredObject->mDrawable);
+ // Highlight the dragged object
+ LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject);
}
result = TRUE;
}
}
- else {
+
+ if (!result && !mDragHoveredObject.isNull())
+ {
+ LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);
mDragHoveredObject = NULL;
}
}
+
return result;
}
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 428c602b73..c3aa1b2407 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -476,6 +476,7 @@ protected:
static std::string sMovieBaseName;
private:
+ // Object temporarily hovered over while dragging
LLPointer<LLViewerObject> mDragHoveredObject;
};