| Index: ui/views/controls/button/custom_button.cc
|
| diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
|
| index 0e237a312732e9703f3ec37cd79533f472cd31d7..8e4586d63df5c3d69253727be0e4408c9e89eee1 100644
|
| --- a/ui/views/controls/button/custom_button.cc
|
| +++ b/ui/views/controls/button/custom_button.cc
|
| @@ -127,7 +127,8 @@ const char* CustomButton::GetClassName() const {
|
|
|
| bool CustomButton::OnMousePressed(const ui::MouseEvent& event) {
|
| if (state_ != STATE_DISABLED) {
|
| - if (ShouldEnterPushedState(event) && HitTestPoint(event.location()))
|
| + if (ShouldEnterPushedState(event) &&
|
| + HitTestPoint(gfx::ToFlooredPoint(event.location())))
|
| SetState(STATE_PRESSED);
|
| if (request_focus_on_press_)
|
| RequestFocus();
|
| @@ -137,7 +138,7 @@ bool CustomButton::OnMousePressed(const ui::MouseEvent& event) {
|
|
|
| bool CustomButton::OnMouseDragged(const ui::MouseEvent& event) {
|
| if (state_ != STATE_DISABLED) {
|
| - if (HitTestPoint(event.location()))
|
| + if (HitTestPoint(gfx::ToFlooredPoint(event.location())))
|
| SetState(ShouldEnterPushedState(event) ? STATE_PRESSED : STATE_HOVERED);
|
| else
|
| SetState(STATE_NORMAL);
|
| @@ -149,7 +150,7 @@ void CustomButton::OnMouseReleased(const ui::MouseEvent& event) {
|
| if (state_ == STATE_DISABLED)
|
| return;
|
|
|
| - if (!HitTestPoint(event.location())) {
|
| + if (!HitTestPoint(gfx::ToFlooredPoint(event.location()))) {
|
| SetState(STATE_NORMAL);
|
| return;
|
| }
|
| @@ -181,7 +182,9 @@ void CustomButton::OnMouseExited(const ui::MouseEvent& event) {
|
|
|
| void CustomButton::OnMouseMoved(const ui::MouseEvent& event) {
|
| if (state_ != STATE_DISABLED)
|
| - SetState(HitTestPoint(event.location()) ? STATE_HOVERED : STATE_NORMAL);
|
| + SetState(HitTestPoint(gfx::ToFlooredPoint(event.location()))
|
| + ? STATE_HOVERED
|
| + : STATE_NORMAL);
|
| }
|
|
|
| bool CustomButton::OnKeyPressed(const ui::KeyEvent& event) {
|
|
|