Fixed issues with the touch coordinates in landscape mode.
In landscape mode the frame stays the same, and the transform property is modified with the appropriate rotation. The touch coordinates are rotated by the transform, so if I want to normalize them by the frame rect, I have to transform the frame rect first.
This commit is contained in:
parent
f9a731d576
commit
5759a8f1db
3 changed files with 19 additions and 15 deletions
|
@ -138,16 +138,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
if (w == frame.size.width && h == frame.size.height) {
|
||||
return;
|
||||
}
|
||||
|
||||
frame.size.width = w;
|
||||
frame.size.height = h;
|
||||
frame.origin.x = 0;
|
||||
frame.origin.y = 0;
|
||||
|
||||
[uiwindow setFrame:frame];
|
||||
[data->view setFrame:frame];
|
||||
[data->view updateFrame];
|
||||
SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue