summaryrefslogtreecommitdiff
path: root/indra/llui/llbutton.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-10-06 20:34:38 -0700
committerMerov Linden <merov@lindenlab.com>2010-10-06 20:34:38 -0700
commit2ffd7aad9fa04b910e5079e59b75330fcfa8beab (patch)
tree6cc704ab6c32c40c017c03d3ba1e1b6f081f2fb9 /indra/llui/llbutton.cpp
parent54bfe1c3e6e09e2733b7f9cd13dd6f39579b8168 (diff)
parent862a951880a8dfb2096b8bb88842f427d3c5f152 (diff)
Rolling back 28f52b3d2e3d : optimizations in button rendering
Diffstat (limited to 'indra/llui/llbutton.cpp')
-rw-r--r--indra/llui/llbutton.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index d51276bf26..f014a2a98d 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -114,7 +114,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),
@@ -499,11 +498,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)
@@ -511,7 +506,6 @@ void LLButton::onMouseLeave(S32 x, S32 y, MASK mask)
LLUICtrl::onMouseLeave(x, y, mask);
mNeedsHighlight = FALSE;
- mMouseOver = true;
}
void LLButton::setHighlight(bool b)
@@ -565,10 +559,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();