src/video/uikit/SDL_uikitview.m
changeset 8310 5d9ba2a65baf
parent 6342 ac83b73f0edd
child 8311 40f2e97c4051
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Mon Jul 23 00:14:07 2012 -0400
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Wed Jul 25 20:56:42 2012 -0400
     1.3 @@ -94,6 +94,12 @@
     1.4  
     1.5      if (touch) {
     1.6          CGPoint locationInView = [touch locationInView: self];
     1.7 +        
     1.8 +        /* Make sure UIView points are converted to screen pixels: */
     1.9 +        if ([self respondsToSelector:@selector(contentScaleFactor)]) {
    1.10 +            locationInView.x *= self.contentScaleFactor;
    1.11 +            locationInView.y *= self.contentScaleFactor;
    1.12 +        }
    1.13  
    1.14          /* send moved event */
    1.15          SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);
    1.16 @@ -184,6 +190,12 @@
    1.17  
    1.18      if (touch) {
    1.19          CGPoint locationInView = [touch locationInView: self];
    1.20 +        
    1.21 +        /* Make sure UIView points are converted to screen pixels: */
    1.22 +        if ([self respondsToSelector:@selector(contentScaleFactor)]) {
    1.23 +            locationInView.x *= self.contentScaleFactor;
    1.24 +            locationInView.y *= self.contentScaleFactor;
    1.25 +        }
    1.26  
    1.27          /* send moved event */
    1.28          SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);