From 9b46e116a92ee4d005ae3e1d66a4fbaa270770ec Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 14:44:09 -0700 Subject: PATH-743: Small code refactoring for clean-up. --- indra/newview/llpathfindingpathtool.cpp | 36 ++++++--------------------------- 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index fde2257777..6cf90addab 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -70,14 +70,9 @@ BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask) { if (isAnyPathToolModKeys(pMask)) { - if (isPointAModKeys(pMask)) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); - } - else if (isPointBModKeys(pMask)) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); - } + gViewerWindow->setCursor(isPointAModKeys(pMask) + ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD + : UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); computeFinalPoints(pX, pY, pMask); mIsLeftMouseButtonHeld = true; setMouseCapture(TRUE); @@ -167,28 +162,9 @@ BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask) if (!mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask)) { - if (isPointAModKeys(pMask)) - { - if (mIsLeftMouseButtonHeld) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); - } - else - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); - } - } - else if (isPointBModKeys(pMask)) - { - if (mIsLeftMouseButtonHeld) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); - } - else - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); - } - } + gViewerWindow->setCursor(isPointAModKeys(pMask) + ? (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_START) + : (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_END)); computeTempPoints(pX, pY, pMask); returnVal = TRUE; } -- cgit v1.2.3