Correct mouse event coordinates in wxMSW wxUIActionSimulator.
The rounding of the floating point division was not done quite correctly. Closes #13383. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -65,8 +65,8 @@ bool wxUIActionSimulator::MouseMove(long x, long y)
|
||||
int displayx, displayy;
|
||||
wxDisplaySize(&displayx, &displayy);
|
||||
|
||||
int scaledx = wxRound(((float)x / displayx) * 65535);
|
||||
int scaledy = wxRound(((float)y / displayy) * 65535);
|
||||
int scaledx = std::ceil((float)x * 65535.0 / (displayx-1));
|
||||
int scaledy = std::ceil((float)y * 65535.0 / (displayy-1));
|
||||
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, scaledx, scaledy, 0, 0);
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user