diff options
| author | Andrew Dyukov <adyukov@productengine.com> | 2009-11-13 18:12:55 +0200 | 
|---|---|---|
| committer | Andrew Dyukov <adyukov@productengine.com> | 2009-11-13 18:12:55 +0200 | 
| commit | 3add88cd9775639b10e8bb8090bc39470588ffa4 (patch) | |
| tree | 3450b20641a826481568ed0cc62c88adab167d25 /indra | |
| parent | 63ea6ccf58b8d275ddd96b3e6fc9eaf76d8508ff (diff) | |
Fixed normal bug EXT-1014 (Unable to move undocked camera controls bar)
--HG--
branch : product-engine
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/lljoystickbutton.cpp | 23 | ||||
| -rw-r--r-- | indra/newview/lljoystickbutton.h | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_camera.xml | 1 | 
3 files changed, 22 insertions, 4 deletions
| diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index bd6702a0b2..d7eaad94f0 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -134,16 +134,31 @@ void LLJoystick::updateSlop()  	return;  } +BOOL LLJoystick::pointInCircle(S32 x, S32 y) const  +{  +	//cnt is x and y coordinates of center of joystick circle, and also its radius, +	//because area is not just rectangular, it's a square! +	//Make sure to change method if this changes. +	int cnt = this->getLocalRect().mTop/2; +	if((x-cnt)*(x-cnt)+(y-cnt)*(y-cnt)<=cnt*cnt) +		return TRUE; +	return FALSE; +}  BOOL LLJoystick::handleMouseDown(S32 x, S32 y, MASK mask)  {  	//llinfos << "joystick mouse down " << x << ", " << y << llendl; +	bool handles = false; -	mLastMouse.set(x, y); -	mFirstMouse.set(x, y); +	if(handles = pointInCircle(x, y)) +	{ +		mLastMouse.set(x, y); +		mFirstMouse.set(x, y); +		mMouseDownTimer.reset(); +		handles = LLButton::handleMouseDown(x, y, mask); +	} -	mMouseDownTimer.reset(); -	return LLButton::handleMouseDown(x, y, mask); +	return handles;  } diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h index 4c657913b8..0465f78031 100644 --- a/indra/newview/lljoystickbutton.h +++ b/indra/newview/lljoystickbutton.h @@ -78,6 +78,8 @@ public:  	static void		onBtnHeldDown(void *userdata);		// called by llbutton callback handler  	void            setInitialQuadrant(EJoystickQuadrant initial) { mInitialQuadrant = initial; }; + +	BOOL			pointInCircle(S32 x, S32 y) const;  	static std::string nameFromQuadrant(const EJoystickQuadrant quadrant);  	static EJoystickQuadrant quadrantFromName(const std::string& name); diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 2af451400e..f553184c19 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -107,6 +107,7 @@           image_unselected="Cam_Rotate_Out"           layout="topleft"           left="45" +         mouse_opaque="false"            name="cam_rotate_stick"           quadrant="left"           scale_image="false" | 
