From 2ca3f5c2fad9a4e94d12026f70c52bda8cfc6e02 Mon Sep 17 00:00:00 2001 From: Beeks Date: Sat, 23 Oct 2010 19:11:56 -0400 Subject: [PATCH] A few tweaks for the Align tool. Disabled the control handles if you can't move the object. Signed-off-by: Beeks --- indra/newview/qtoolalign.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/indra/newview/qtoolalign.cpp b/indra/newview/qtoolalign.cpp index 56c0ed7e2..166c93f6a 100644 --- a/indra/newview/qtoolalign.cpp +++ b/indra/newview/qtoolalign.cpp @@ -415,8 +415,25 @@ void QToolAlign::render() LLColor4 default_normal_color( 0.7f, 0.7f, 0.7f, 0.1f ); gGL.color4fv( default_normal_color.mV ); - render_bbox(mBBox); - renderManipulators(); + + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getEditSelection(); + BOOL can_move = selection->getObjectCount() != 0; + if (can_move) + { + struct f : public LLSelectedObjectFunctor + { + virtual bool apply(LLViewerObject* objectp) + { + return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + } + } func; + can_move = selection->applyToObjects(&func); + } + if (can_move) + { + render_bbox(mBBox); + renderManipulators(); + } } // only works for our specialized (AABB, position centered) bboxes