Added Middle Mouse control to scale manipulator to invert uniform scaling.

ziree 2012-03-26 02:51:38 +02:00
parent 86146e1f07
commit d083249aa5
4 changed files with 48 additions and 1 deletions

View File

@ -69,6 +69,8 @@ const F32 SELECTED_MANIPULATOR_SCALE = 1.2f;
const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f;
const S32 NUM_MANIPULATORS = 14;
BOOL LLManipScale::mInvertUniform=FALSE; // <FS:Zi> Add middle mouse control for switching uniform scaling on the fly
const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] =
{
LLManip::LL_CORNER_NNN,
@ -130,7 +132,10 @@ void LLManipScale::setStretchTextures(BOOL b)
// static
BOOL LLManipScale::getUniform()
{
return gSavedSettings.getBOOL("ScaleUniform");
// <FS:Zi> Add middle mouse control for switching uniform scaling on the fly
// return gSavedSettings.getBOOL("ScaleUniform");
return (gSavedSettings.getBOOL("ScaleUniform") ^ mInvertUniform);
// </FS:Zi>
}
// static
@ -2082,3 +2087,17 @@ BOOL LLManipScale::canAffectSelection()
}
return can_scale;
}
// <FS:Zi> Add middle mouse control for switching uniform scaling on the fly
BOOL LLManipScale::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
LLManipScale::mInvertUniform=TRUE;
return handleMouseDown(x,y,mask);
}
BOOL LLManipScale::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
{
LLManipScale::mInvertUniform=FALSE;
return handleMouseUp(x, y, mask);
}
// </FS:Zi>

View File

@ -163,6 +163,15 @@ private:
F32 mScaleSnapValue;
BOOL mInSnapRegime;
F32* mManipulatorScales;
// <FS:Zi> Add middle mouse control for switching uniform scaling on the fly
public:
virtual BOOL handleMiddleMouseDown( S32 x, S32 y, MASK mask );
virtual BOOL handleMiddleMouseUp( S32 x, S32 y, MASK mask );
private:
static BOOL mInvertUniform;
// </FS:Zi>
};
#endif // LL_MANIPSCALE_H

View File

@ -435,6 +435,20 @@ void LLToolCompScale::render()
}
}
// <FS:Zi> Add middle mouse control for switching uniform scaling on the fly
BOOL LLToolCompScale::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
LLToolCompScale::getInstance()->mManip->handleMiddleMouseDown(x,y,mask);
return handleMouseDown(x,y,mask);
}
BOOL LLToolCompScale::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
{
LLToolCompScale::getInstance()->mManip->handleMiddleMouseUp(x,y,mask);
return handleMouseUp(x,y,mask);
}
// </FS:Zi>
//-----------------------------------------------------------------------
// LLToolCompCreate

View File

@ -156,6 +156,11 @@ public:
virtual LLTool* getOverrideTool(MASK mask);
static void pickCallback(const LLPickInfo& pick_info);
// <FS:Zi> Add middle mouse control for switching uniform scaling on the fly
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask);
// </FS:Zi>
};