Changeset 38271 in vbox for trunk/src/VBox
- Timestamp:
- Aug 1, 2011 9:01:03 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/MouseImpl.cpp
r38242 r38271 48 48 MOUSE_RANGE_LOWER = 0, 49 49 /** Higher end */ 50 MOUSE_RANGE_UPPER = 0xFFFF 50 MOUSE_RANGE_UPPER = 0xFFFF, 51 /** Full range */ 52 MOUSE_RANGE = MOUSE_RANGE_UPPER - MOUSE_RANGE_LOWER 51 53 }; 52 54 /** @} */ … … 501 503 return rc; 502 504 503 *pcX = displayWidth ? ( (x - 1) * MOUSE_RANGE_UPPER) / (LONG) displayWidth: 0;504 *pcY = displayHeight ? ( (y - 1) * MOUSE_RANGE_UPPER) / (LONG) displayHeight: 0;505 *pcX = displayWidth ? (x * MOUSE_RANGE - MOUSE_RANGE / 2) / (LONG) displayWidth: 0; 506 *pcY = displayHeight ? (y * MOUSE_RANGE - MOUSE_RANGE / 2) / (LONG) displayHeight: 0; 505 507 } 506 508 else … … 509 511 /* Takes the display lock */ 510 512 pDisplay->getFramebufferDimensions(&x1, &y1, &x2, &y2); 511 *pcX = x1 < x2 ? ( x - 1 - x1) * MOUSE_RANGE_UPPER / (x2 - x1 -1) : 0;512 *pcY = y1 < y2 ? ( y - 1 - y1) * MOUSE_RANGE_UPPER / (y2 - y1 -1) : 0;513 *pcX = x1 < x2 ? ((x - x1) * MOUSE_RANGE - MOUSE_RANGE / 2) / (x2 - x1) : 0; 514 *pcY = y1 < y2 ? ((y - y1) * MOUSE_RANGE - MOUSE_RANGE / 2) / (y2 - y1) : 0; 513 515 if ( *pcX < MOUSE_RANGE_LOWER || *pcX > MOUSE_RANGE_UPPER 514 516 || *pcY < MOUSE_RANGE_LOWER || *pcY > MOUSE_RANGE_UPPER)
Note:
See TracChangeset
for help on using the changeset viewer.