Fixed issue with touch input on retina displays
authorSam Lantinga
Sat, 29 Sep 2012 17:38:54 -0700
changeset 6519fc926eedd78a
parent 6518 42948831d16e
child 6520 7a7726af31c1
Fixed issue with touch input on retina displays
src/video/uikit/SDL_uikitview.m
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Sat Sep 29 17:23:40 2012 -0700
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Sat Sep 29 17:38:54 2012 -0700
     1.3 @@ -85,13 +85,14 @@
     1.4      SDL_Window *window = self->viewcontroller.window;
     1.5      SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
     1.6      SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata;
     1.7 -    point.x *= displaymodedata->scale;
     1.8 -    point.y *= displaymodedata->scale;
     1.9      
    1.10      if (normalize) {
    1.11          CGRect bounds = [self bounds];
    1.12          point.x /= bounds.size.width;
    1.13          point.y /= bounds.size.height;
    1.14 +    } else {
    1.15 +        point.x *= displaymodedata->scale;
    1.16 +        point.y *= displaymodedata->scale;
    1.17      }
    1.18      return point;
    1.19  }