Add --rotation command-line option

In addition to Ctrl+Left and Ctrl+Right shortcuts, add a command-line
parameter to set the initial rotation.
This commit is contained in:
Romain Vimont
2020-04-08 10:17:12 +02:00
parent d48b375a1d
commit 28c71c528f
7 changed files with 67 additions and 3 deletions

View File

@@ -178,8 +178,13 @@ bool
screen_init_rendering(struct screen *screen, const char *window_title,
struct size frame_size, bool always_on_top,
int16_t window_x, int16_t window_y, uint16_t window_width,
uint16_t window_height, bool window_borderless) {
uint16_t window_height, bool window_borderless,
uint8_t rotation) {
screen->frame_size = frame_size;
screen->rotation = rotation;
if (rotation) {
LOGI("Initial display rotation set to %u", rotation);
}
struct size content_size =
get_rotated_size(frame_size, screen->rotation);