diff options
author | Merov Linden <merov@lindenlab.com> | 2010-10-06 20:22:53 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2010-10-06 20:22:53 -0700 |
commit | 862a951880a8dfb2096b8bb88842f427d3c5f152 (patch) | |
tree | b5e1245eb7d75c1ab1ee5c0530d8006a2255759a /indra/llui | |
parent | cba6943b27d447719f88bc9515da773eb3aea288 (diff) |
Backed out changeset 28f52b3d2e3d (optimizations in button rendering).
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llbutton.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llbutton.h | 1 |
2 files changed, 5 insertions, 8 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 5a4f0515fc..aeedf62379 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -120,7 +120,6 @@ LLButton::LLButton(const LLButton::Params& p) mFlashing( FALSE ), mCurGlowStrength(0.f), mNeedsHighlight(FALSE), - mMouseOver(false), mUnselectedLabel(p.label()), mSelectedLabel(p.label_selected()), mGLFont(p.font), @@ -505,11 +504,7 @@ void LLButton::onMouseEnter(S32 x, S32 y, MASK mask) LLUICtrl::onMouseEnter(x, y, mask); if (isInEnabledChain()) - { mNeedsHighlight = TRUE; - } - - mMouseOver = true; } void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) @@ -517,7 +512,6 @@ void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) LLUICtrl::onMouseLeave(x, y, mask); mNeedsHighlight = FALSE; - mMouseOver = true; } void LLButton::setHighlight(bool b) @@ -571,10 +565,14 @@ void LLButton::draw() } // Unselected image assignments + S32 local_mouse_x; + S32 local_mouse_y; + LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + bool enabled = isInEnabledChain(); bool pressed = pressed_by_keyboard - || (hasMouseCapture() && mMouseOver) + || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) || mForcePressedState; bool selected = getToggleState(); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 5f25084b35..f4af19b696 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -356,7 +356,6 @@ private: BOOL mCommitOnReturn; BOOL mFadeWhenDisabled; bool mForcePressedState; - bool mMouseOver; LLFrameTimer mFlashingTimer; }; |