diff options
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r-- | indra/newview/llscreenchannel.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 7c2e7e3319..c75d90be6f 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -79,17 +79,12 @@ LLScreenChannelBase::~LLScreenChannelBase() bool LLScreenChannelBase::isHovering() { - bool res = mHoveredToast != NULL; - if (!res) + if (!mHoveredToast) { - return res; + return false; } - S32 x, y; - mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(), - gViewerWindow->getCurrentMouseY(), &x, &y); - res = mHoveredToast->pointInView(x, y) == TRUE; - return res; + return mHoveredToast->isHovered(); } void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect) @@ -479,7 +474,8 @@ void LLScreenChannel::showToastsBottom() { if(it != mToastList.rbegin()) { - bottom = (*(it-1)).toast->getRect().mTop; + LLToast* toast = (*(it-1)).toast; + bottom = toast->getRect().mTop - toast->getTopPad(); toast_margin = gSavedSettings.getS32("ToastGap"); } @@ -777,23 +773,16 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter) { // because of LLViewerWindow::updateUI() that NOT ALWAYS calls onMouseEnter BEFORE onMouseLeave // we must check hovering directly to prevent incorrect setting for hovering in a channel - S32 x,y; if (mouse_enter) { - toast->screenPointToLocal(gViewerWindow->getCurrentMouseX(), - gViewerWindow->getCurrentMouseY(), &x, &y); - bool hover = toast->pointInView(x, y) == TRUE; - if (hover) + if (toast->isHovered()) { mHoveredToast = toast; } } else if (mHoveredToast != NULL) { - mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(), - gViewerWindow->getCurrentMouseY(), &x, &y); - bool hover = mHoveredToast->pointInView(x, y) == TRUE; - if (!hover) + if (!mHoveredToast->isHovered()) { mHoveredToast = NULL; } |