From 2e47e6d816f08bf75ed7dd06230996cfa606a737 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 25 Mar 2010 17:21:39 -0600 Subject: fix for EXT-5854:Unable to Pay Object That Features Transparant (alpha) Texture. (transplanted from 3939f139f6caff2bb192a2afde18e51aada4d57a) --- indra/llrender/llimagegl.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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; -- cgit v1.2.3 From 12e570913cadc1c2abb82306d42f9cd93dd7cba6 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 26 Mar 2010 16:57:56 -0700 Subject: EXT-EXT-6317 - cursor does not indicate clicking will trigger an action when over transparent objects reviewed by Leyla (transplanted from 4b90aa824b05ef6d29973b55bec8eb6210e1edf9) --- indra/newview/lltoolpie.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- cgit v1.2.3 From 6a1677d9e5907b4e34a0e71084a95c1fa138569d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 26 Mar 2010 08:54:58 +0000 Subject: If the EXT-5854 fix is correct, this assert no longer makes sense. (transplanted from 3bef6f249a0ab74f823e67fb32339abb92b13165) --- indra/llrender/llimagegl.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index cd851cf8a3..8addee606b 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1749,8 +1749,6 @@ BOOL LLImageGL::getMask(const LLVector2 &tc) llassert(false); } - llassert(mPickMaskWidth >= 0 && mPickMaskHeight >= 0); - S32 x = llfloor(u * mPickMaskWidth); S32 y = llfloor(v * mPickMaskHeight); -- cgit v1.2.3