]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/uiaction.cpp
Fix command line parsing in media player sample.
[wxWidgets.git] / src / msw / uiaction.cpp
index 56ea8fa3a949cb64607498f4101c6c2509ce4235..5aff359052527b1f53867bc8eec7a167997de887 100644 (file)
@@ -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 = ceil((float)x * 65535.0 / (displayx-1));
+    int scaledy = ceil((float)y * 65535.0 / (displayy-1));
     mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, scaledx, scaledy, 0, 0);
 
     return true;