MAINT-6025 FIXED "ctrl + z" not working on non-mod objects
parent
86ee5d92fc
commit
f412042e90
|
|
@ -6746,7 +6746,8 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::canUndo() const
|
||||
{
|
||||
return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG
|
||||
// Can edit or can move
|
||||
return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstUndoEnabledObject() != NULL; // HACK: casting away constness - MG;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -7671,6 +7672,22 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent)
|
|||
return getFirstSelectedObject(&func, get_parent);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// getFirstUndoEnabledObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(BOOL get_parent)
|
||||
{
|
||||
struct f : public LLSelectedNodeFunctor
|
||||
{
|
||||
bool apply(LLSelectNode* node)
|
||||
{
|
||||
LLViewerObject* obj = node->getObject();
|
||||
return obj && (obj->permModify() || (obj->permMove() && !obj->isPermanentEnforced()));
|
||||
}
|
||||
} func;
|
||||
return getFirstSelectedObject(&func, get_parent);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Position + Rotation update methods called from LLViewerJoystick
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ public:
|
|||
LLViewerObject* getFirstCopyableObject(BOOL get_parent = FALSE);
|
||||
LLViewerObject* getFirstDeleteableObject();
|
||||
LLViewerObject* getFirstMoveableObject(BOOL get_parent = FALSE);
|
||||
LLViewerObject* getFirstUndoEnabledObject(BOOL get_parent = FALSE);
|
||||
|
||||
/// Return the object that lead to this selection, possible a child
|
||||
LLViewerObject* getPrimaryObject() { return mPrimaryObject; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue