diff --git a/selfdrive/ui/qt/widgets/cameraview.cc b/selfdrive/ui/qt/widgets/cameraview.cc index 016129c348..ffcd1b3aab 100644 --- a/selfdrive/ui/qt/widgets/cameraview.cc +++ b/selfdrive/ui/qt/widgets/cameraview.cc @@ -62,11 +62,14 @@ const char frame_fragment_shader[] = #endif mat4 get_driver_view_transform(int screen_width, int screen_height, int stream_width, int stream_height) { + UIState *s = uiState(); + const float driver_view_ratio = 2.0; const float yscale = stream_height * driver_view_ratio / stream_width; const float xscale = yscale*screen_height/screen_width*stream_width/stream_height; + float xscale_invert = (s->scene.reverse_dm_cam ? -xscale : xscale); mat4 transform = (mat4){{ - xscale, 0.0, 0.0, 0.0, + xscale_invert, 0.0, 0.0, 0.0, 0.0, yscale, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,