From 00bb6a5ecd09b5ae0a209ad68fe1998b70b66e04 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 30 Nov 2016 21:25:06 +0200 Subject: MAINT-6803 Account for deselection --- indra/newview/llselectmgr.cpp | 5 +++++ indra/newview/llselectmgr.h | 1 + indra/newview/llviewermenu.cpp | 18 +++++++++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e07c11b1e3..dd934ce6b8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6006,6 +6006,11 @@ S32 LLSelectNode::getLastSelectedTE() return mLastTESelected; } +S32 LLSelectNode::getLastOperatedTE() +{ + return mLastTESelected; +} + LLViewerObject* LLSelectNode::getObject() { if (!mObject) diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index c167ecd236..2a893af266 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -170,6 +170,7 @@ public: void selectTE(S32 te_index, BOOL selected); BOOL isTESelected(S32 te_index); S32 getLastSelectedTE(); + S32 getLastOperatedTE(); S32 getTESelectMask() { return mTESelectMask; } void renderOneWireframe(const LLColor4& color); void renderOneSilhouette(const LLColor4 &color); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 24df985e3a..f904cc6eb8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5227,11 +5227,15 @@ class LLToolsSelectNextPartFace : public view_listener_t if (!to_select) return false; S32 te_count = to_select->getNumTEs(); - S32 selected_te = nodep->getLastSelectedTE(); + S32 selected_te = nodep->getLastOperatedTE(); - if ((fwd || ifwd) && selected_te >= 0) + if (fwd || ifwd) { - if (selected_te + 1 < te_count) + if (selected_te < 0) + { + new_te = 0; + } + else if (selected_te + 1 < te_count) { // select next face new_te = selected_te + 1; @@ -5242,9 +5246,13 @@ class LLToolsSelectNextPartFace : public view_listener_t restart_face_on_part = true; } } - else if ((prev || iprev) && selected_te < te_count) + else if (prev || iprev) { - if (selected_te - 1 >= 0) + if (selected_te > te_count) + { + new_te = te_count - 1; + } + else if (selected_te - 1 >= 0) { // select previous face new_te = selected_te - 1; -- cgit v1.2.3