From d0bc4fc5e656b07308fe5fe0dc99ed78c00efd78 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 9 Sep 2010 19:07:07 -0700 Subject: DEV-53015 FIX Volume slider disappears when sliding on panel_prim_media_controls.xml --- indra/llui/llbutton.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index f014a2a98d..65ef3e5f8f 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -558,15 +558,19 @@ void LLButton::draw() pressed_by_keyboard = gKeyboard->getKeyDown(' ') || (mCommitOnReturn && gKeyboard->getKeyDown(KEY_RETURN)); } - // Unselected image assignments - S32 local_mouse_x; - S32 local_mouse_y; - LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + bool mouse_pressed_and_over = false; + if (hasMouseCapture()) + { + S32 local_mouse_x ; + S32 local_mouse_y; + LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + mouse_pressed_and_over = pointInView(local_mouse_x, local_mouse_y); + } bool enabled = isInEnabledChain(); bool pressed = pressed_by_keyboard - || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) + || mouse_pressed_and_over || mForcePressedState; bool selected = getToggleState(); -- cgit v1.2.3