Exemple #1
0
	Canvas::~Canvas()
	{
		// reset framebuffer if still using this one
		if (current == this)
			stopGrab();

		unloadVolatile();
	}
Exemple #2
0
void LLToolGrab::onMouseCaptureLost()
{
	LLViewerObject* objectp = mGrabPick.getObject();
	if (!objectp)
	{
		gViewerWindow->showCursor();
		return;
	}
	// First, fix cursor placement
	if( !gAgent.cameraMouselook() 
		&& (GRAB_ACTIVE_CENTER == mMode))
	{
		if (objectp->isHUDAttachment())
		{
			// ...move cursor "naturally", as if it had moved when hidden
			S32 x = mGrabPick.mMousePt.mX + mAccumDeltaX;
			S32 y = mGrabPick.mMousePt.mY + mAccumDeltaY;
			LLUI::setCursorPositionScreen(x, y);
		}
		else if (mHasMoved)
		{
			// ...move cursor back to the center of the object
			LLVector3 grab_point_agent = objectp->getRenderPosition();

			LLCoordGL gl_point;
			if (LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_point_agent, gl_point))
			{
				LLUI::setCursorPositionScreen(gl_point.mX, gl_point.mY);
			}
		}
		else
		{
			// ...move cursor back to click position
			LLUI::setCursorPositionScreen(mGrabPick.mMousePt.mX, mGrabPick.mMousePt.mY);
		}

		gViewerWindow->showCursor();
	}

	stopGrab();
	if (mSpinGrabbing)
	stopSpin();
	
	mMode = GRAB_INACTIVE;

	mHideBuildHighlight = FALSE;

	mGrabPick.mObjectID.setNull();

	LLSelectMgr::getInstance()->updateSelectionCenter();
	gAgent.setPointAt(POINTAT_TARGET_CLEAR);
	gAgent.setLookAt(LOOKAT_TARGET_CLEAR);

	dialog_refresh_all();
}