diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 48822f0451..71de6ae3aa 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -1334,6 +1334,14 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
void LLPanelEditWearable::showDefaultSubpart()
{
+ // Correct camera position for last subpart
+ std::map::iterator found = mLastShownSubpartIndex.find(mWearablePtr->getType());
+ if (found != mLastShownSubpartIndex.end())
+ {
+ changeCamera(found->second);
+ }
+ else
+ //
changeCamera(0);
}
@@ -1349,6 +1357,7 @@ void LLPanelEditWearable::onTabExpandedCollapsed(const LLSD& param, U8 index)
if (expanded)
{
+ mLastShownSubpartIndex[mWearablePtr->getType()] = index; // Correct camera position for last subpart
changeCamera(index);
}
@@ -1383,6 +1392,7 @@ void LLPanelEditWearable::onTabChanged(LLUICtrl* ctrl, LLWearableType::EType typ
if (subpart_entry && container->getCurrentPanel()->hasChild(subpart_entry->mAccordionTab, TRUE))
{
+ mLastShownSubpartIndex[type] = index; // Correct camera position for last subpart
changeCamera(index);
break;
}
diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h
index 8d859dcc35..b0d5623308 100644
--- a/indra/newview/llpaneleditwearable.h
+++ b/indra/newview/llpaneleditwearable.h
@@ -183,6 +183,8 @@ private:
typedef std::map s32_uuid_map_t;
s32_uuid_map_t mPreviousAlphaTexture;
+
+ std::map mLastShownSubpartIndex;
};
#endif