PHOE-3432 : Fixed rotation copy from one prim to another not working if rotation is zero zero zero

Sat, 10 Mar 2012 20:15:46 -0800

author
Kadah_Coba <kadah.coba@gmail.com>
date
Sat, 10 Mar 2012 20:15:46 -0800
changeset 1674
b0890f7568f2
parent 1673
045c423f7390
child 1675
1862396ac745

PHOE-3432 : Fixed rotation copy from one prim to another not working if rotation is zero zero zero

indra/newview/llpanelobject.cpp file | annotate | diff | revisions
indra/newview/llpanelobject.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/llpanelobject.cpp	Sat Mar 10 19:13:22 2012 -0800
     1.2 +++ b/indra/newview/llpanelobject.cpp	Sat Mar 10 20:15:46 2012 -0800
     1.3 @@ -133,6 +133,9 @@
     1.4  LLVector3 LLPanelObject::mClipboardRot;
     1.5  
     1.6  LLVolumeParams LLPanelObject::mClipboardVolumeParams;
     1.7 +BOOL LLPanelObject::hasPosClipboard = FALSE;
     1.8 +BOOL LLPanelObject::hasSizeClipboard = FALSE;
     1.9 +BOOL LLPanelObject::hasRotClipboard = FALSE;
    1.10  BOOL LLPanelObject::hasParamClipboard = FALSE;
    1.11  BOOL LLPanelObject::hasFlexiParam = FALSE;
    1.12  BOOL LLPanelObject::hasSculptParam = FALSE;
    1.13 @@ -2455,6 +2458,7 @@
    1.14  	mClipboardPos = LLVector3(self->mCtrlPosX->get(), self->mCtrlPosY->get(), self->mCtrlPosZ->get());
    1.15  	copy_vector_to_clipboard(mClipboardPos);
    1.16  	self->mBtnPastePos->setToolTip(llformat("Paste Position\n<%g, %g, %g>", mClipboardPos.mV[VX], mClipboardPos.mV[VY], mClipboardPos.mV[VZ]));
    1.17 +	hasPosClipboard = TRUE;
    1.18  }
    1.19  
    1.20  void LLPanelObject::onCopySize(void* user_data)
    1.21 @@ -2464,6 +2468,7 @@
    1.22  	mClipboardSize = LLVector3(self->mCtrlScaleX->get(), self->mCtrlScaleY->get(), self->mCtrlScaleZ->get());
    1.23  	copy_vector_to_clipboard(mClipboardSize);
    1.24  	self->mBtnPasteSize->setToolTip(llformat("Paste Size\n<%g, %g, %g>", mClipboardSize.mV[VX], mClipboardSize.mV[VY], mClipboardSize.mV[VZ]));
    1.25 +	hasSizeClipboard = TRUE;
    1.26  }
    1.27  
    1.28  void LLPanelObject::onCopyRot(void* user_data)
    1.29 @@ -2473,13 +2478,14 @@
    1.30  	mClipboardRot = LLVector3(self->mCtrlRotX->get(), self->mCtrlRotY->get(), self->mCtrlRotZ->get());
    1.31  	copy_vector_to_clipboard(mClipboardRot);
    1.32  	self->mBtnPasteRot->setToolTip(llformat("Paste Rotation\n<%g, %g, %g>", mClipboardRot.mV[VX], mClipboardRot.mV[VY], mClipboardRot.mV[VZ]));
    1.33 +	hasRotClipboard = TRUE;
    1.34  }
    1.35  
    1.36  void LLPanelObject::onPastePos(void* user_data)
    1.37  {
    1.38  	LLPanelObject* self = (LLPanelObject*) user_data;
    1.39  
    1.40 -	if(mClipboardPos.isNull()) return;
    1.41 +	if(!hasPosClipboard) return;
    1.42  
    1.43  	//clamp pos on non-attachments, just keep the prims on the sim
    1.44  	if (!self->mObject->isAttachment())
    1.45 @@ -2504,7 +2510,7 @@
    1.46  {
    1.47  	LLPanelObject* self = (LLPanelObject*) user_data;
    1.48  
    1.49 -	if(mClipboardSize.isNull()) return;
    1.50 +	if(!hasSizeClipboard) return;
    1.51  
    1.52  	mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], MIN_PRIM_SCALE, gHippoLimits->getMaxPrimScale());
    1.53  	mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], MIN_PRIM_SCALE, gHippoLimits->getMaxPrimScale());
    1.54 @@ -2525,7 +2531,7 @@
    1.55  {
    1.56  	LLPanelObject* self = (LLPanelObject*) user_data;
    1.57  
    1.58 -	if(mClipboardRot.isNull()) return;
    1.59 +	if(!hasRotClipboard) return;
    1.60  
    1.61  
    1.62  	self->mCtrlRotX->set( mClipboardRot.mV[VX] );
     2.1 --- a/indra/newview/llpanelobject.h	Sat Mar 10 19:13:22 2012 -0800
     2.2 +++ b/indra/newview/llpanelobject.h	Sat Mar 10 20:15:46 2012 -0800
     2.3 @@ -116,6 +116,9 @@
     2.4  	
     2.5  protected:
     2.6  
     2.7 +	static BOOL hasPosClipboard;
     2.8 +	static BOOL hasSizeClipboard;
     2.9 +	static BOOL hasRotClipboard;
    2.10  	static LLVector3 mClipboardPos;
    2.11  	static LLVector3 mClipboardSize;
    2.12  	static LLVector3 mClipboardRot;

mercurial