summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorKent Quirk <q@lindenlab.com>2010-04-12 17:59:22 -0400
committerKent Quirk <q@lindenlab.com>2010-04-12 17:59:22 -0400
commit8a3dca48ebb9d2c48c58187f8e49849c6830737d (patch)
tree2f310864b495ef3817208a9f0984d2d9a544bc4b /indra
parent9572c5ed1b14096ffc31963512a7a6567578ff30 (diff)
parent12e570913cadc1c2abb82306d42f9cd93dd7cba6 (diff)
Merge
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llimagegl.cpp14
-rw-r--r--indra/newview/lltoolpie.cpp7
2 files changed, 12 insertions, 9 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 68b556c3bb..cd851cf8a3 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1705,8 +1705,8 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
U32 size = pick_width * pick_height;
size = (size + 7) / 8; // pixelcount-to-bits
mPickMask = new U8[size];
- mPickMaskWidth = pick_width;
- mPickMaskHeight = pick_height;
+ mPickMaskWidth = pick_width - 1;
+ mPickMaskHeight = pick_height - 1;
memset(mPickMask, 0, sizeof(U8) * size);
@@ -1749,20 +1749,20 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
llassert(false);
}
- llassert(mPickMaskWidth > 0 && mPickMaskHeight > 0);
+ llassert(mPickMaskWidth >= 0 && mPickMaskHeight >= 0);
S32 x = llfloor(u * mPickMaskWidth);
S32 y = llfloor(v * mPickMaskHeight);
- if (LL_UNLIKELY(x >= mPickMaskWidth))
+ if (LL_UNLIKELY(x > mPickMaskWidth))
{
LL_WARNS_ONCE("render") << "Ooh, width overrun on pick mask read, that coulda been bad." << LL_ENDL;
- x = llmax(0, mPickMaskWidth-1);
+ x = llmax((U16)0, mPickMaskWidth);
}
- if (LL_UNLIKELY(y >= mPickMaskHeight))
+ if (LL_UNLIKELY(y > mPickMaskHeight))
{
LL_WARNS_ONCE("render") << "Ooh, height overrun on pick mask read, that woulda been bad." << LL_ENDL;
- y = llmax(0, mPickMaskHeight-1);
+ y = llmax((U16)0, mPickMaskHeight);
}
S32 idx = y*mPickMaskWidth+x;
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index d15db536e6..aa5c99439c 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -496,6 +496,8 @@ void LLToolPie::selectionPropertiesReceived()
BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
{
mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE);
+ // perform a separate pick that detects transparent objects since they respond to 1-click actions
+ LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, TRUE);
// Show screen-space highlight glow effect
bool show_highlight = false;
@@ -507,10 +509,11 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
parent = object->getRootEdit();
}
- if (object && useClickAction(mask, object, parent))
+ LLViewerObject* click_action_object = click_action_pick.getObject();
+ if (click_action_object && useClickAction(mask, click_action_object, click_action_object->getRootEdit()))
{
show_highlight = true;
- ECursorType cursor = cursor_from_object(object);
+ ECursorType cursor = cursor_from_object(click_action_object);
gViewerWindow->setCursor(cursor);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}