Skip to content

Commit

Permalink
* 修复(277149064)提到的movementX 值不对的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
weolar committed May 21, 2018
1 parent bc3dcc4 commit e8cfd08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions content/browser/PlatformEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,11 @@ LRESULT PlatformEventHandler::fireMouseEvent(HWND hWnd, UINT message, WPARAM wPa
webMouseEvent.modifiers = 0;
webMouseEvent.x = pos.x();
webMouseEvent.y = pos.y();
webMouseEvent.movementX = pos.x();
webMouseEvent.movementY = pos.y();

webMouseEvent.movementX = pos.x() - m_lastPosMouseMove.x();
webMouseEvent.movementY = pos.y() - m_lastPosMouseMove.y();
m_lastPosMouseMove = pos;

webMouseEvent.windowX = pos.x();
webMouseEvent.windowY = pos.y();
webMouseEvent.globalX = globalPos.x();
Expand Down
1 change: 1 addition & 0 deletions content/browser/PlatformEventHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class PlatformEventHandler {
bool m_isAlert;
double m_lastTimeMouseDown;
blink::IntPoint m_lastPosMouseDown;
blink::IntPoint m_lastPosMouseMove;
blink::IntRect m_lastPosForDrag;
blink::WebViewImpl* m_webViewImpl;
blink::WebWidget* m_webWidget;
Expand Down

0 comments on commit e8cfd08

Please sign in to comment.