Merge pull request #115434 from syntaxerror247/landscape-or-portrait
Add device orientation change signal to DisplayServer
This commit is contained in:
commit
ea1e6640f0
7 changed files with 38 additions and 8 deletions
|
|
@ -253,6 +253,17 @@
|
|||
if (camera_server) {
|
||||
camera_server->handle_display_rotation_change((int)orientation);
|
||||
}
|
||||
|
||||
DisplayServer *display_server = DisplayServer::get_singleton();
|
||||
if (display_server) {
|
||||
int out = 0;
|
||||
if (UIInterfaceOrientationIsPortrait(orientation)) {
|
||||
out = 1;
|
||||
} else if (UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
out = 2;
|
||||
}
|
||||
display_server->emit_signal("orientation_changed", out);
|
||||
}
|
||||
}];
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue