Fixed bug #642
authorSam Lantinga <slouken@libsdl.org>
Wed, 16 Dec 2009 00:44:53 +0000
changeset 35726bb9952d5029
parent 3571 19691cebb866
child 3573 41cd18e05965
Fixed bug #642

Gerry JJ 2008-11-09 02:11:49 PST

The SDL_MouseMotionEvent struct has a field named "tilt" (currently marked "for
future use"), for tablet stylus tilt information. However, one value is not
enough for this, as tilt is two-dimensional. Reserving only one field for
future use is no good when you're going to need two, so there should be two
fields, tilt_x and tilt_y.
include/SDL_events.h
src/events/SDL_mouse.c
     1.1 --- a/include/SDL_events.h	Tue Dec 15 20:53:09 2009 +0000
     1.2 +++ b/include/SDL_events.h	Wed Dec 16 00:44:53 2009 +0000
     1.3 @@ -186,7 +186,8 @@
     1.4      int pressure_max;       /**< Maximum value of the pressure reported by the device */
     1.5      int pressure_min;       /**< Minimum value of the pressure reported by the device */
     1.6      int rotation;           /**< For future use */
     1.7 -    int tilt;               /**< For future use */
     1.8 +    int tilt_x;             /**< For future use */
     1.9 +    int tilt_y;             /**< For future use */
    1.10      int cursor;             /**< The cursor being used in the event */
    1.11      int xrel;               /**< The relative motion in the X direction */
    1.12      int yrel;               /**< The relative motion in the Y direction */
     2.1 --- a/src/events/SDL_mouse.c	Tue Dec 15 20:53:09 2009 +0000
     2.2 +++ b/src/events/SDL_mouse.c	Wed Dec 16 00:44:53 2009 +0000
     2.3 @@ -473,7 +473,8 @@
     2.4          event.motion.pressure_max = mouse->pressure_max;
     2.5          event.motion.pressure_min = mouse->pressure_min;
     2.6          event.motion.rotation = 0;
     2.7 -        event.motion.tilt = 0;
     2.8 +        event.motion.tilt_x = 0;
     2.9 +        event.motion.tilt_y = 0;
    2.10          event.motion.cursor = mouse->current_end;
    2.11          event.motion.xrel = xrel;
    2.12          event.motion.yrel = yrel;