mirror of
https://github.com/yawut/SDL.git
synced 2026-09-15 04:26:28 -05:00
Fixed issue with touch input on retina displays
This commit is contained in:
@@ -85,13 +85,14 @@
|
||||
SDL_Window *window = self->viewcontroller.window;
|
||||
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
|
||||
SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata;
|
||||
point.x *= displaymodedata->scale;
|
||||
point.y *= displaymodedata->scale;
|
||||
|
||||
if (normalize) {
|
||||
CGRect bounds = [self bounds];
|
||||
point.x /= bounds.size.width;
|
||||
point.y /= bounds.size.height;
|
||||
} else {
|
||||
point.x *= displaymodedata->scale;
|
||||
point.y *= displaymodedata->scale;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user