summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.cpp
diff options
context:
space:
mode:
authorAlexei Arabadji <aarabadji@productengine.com>2009-12-09 12:45:00 +0200
committerAlexei Arabadji <aarabadji@productengine.com>2009-12-09 12:45:00 +0200
commit918eedc4e955062307f9422630cb3b82f7024320 (patch)
tree3e698f940f75627c32c3b4f8f1e85f85c26db413 /indra/newview/llscreenchannel.cpp
parentff87f87fa6a33daf72eae963b2aa33c9d5890509 (diff)
hardened condition for LLScreenChannelBase::isHovering method;
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r--indra/newview/llscreenchannel.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 222b462d1a..f66f725070 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -78,6 +78,22 @@ LLScreenChannelBase::~LLScreenChannelBase()
{
mWorldViewRectConnection.disconnect();
}
+
+bool LLScreenChannelBase::isHovering()
+{
+ bool res = mHoveredToast != NULL;
+ if (!res)
+ {
+ return res;
+ }
+
+ S32 x, y;
+ mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(),
+ gViewerWindow->getCurrentMouseY(), &x, &y);
+ res = mHoveredToast->pointInView(x, y) == TRUE;
+ return res;
+}
+
void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect)
{
S32 top_delta = old_world_rect.mTop - new_world_rect.mTop;
@@ -644,7 +660,7 @@ void LLNotificationsUI::LLScreenChannel::startFadingToasts()
if (!mToastList.size()) return;
//because onMouseLeave is processed after onMouseEnter
- if (mHoveredToast) return;
+ if (isHovering()) return;
std::vector<ToastElem>::iterator it = mToastList.begin();
while (it != mToastList.end())