Files
sunnypilot/selfdrive
Angus Gratton fbcd0821c9 cabana/cameraview: Scale the glViewPort by devicePixelRatio() (#27941)
* cameraview: Scale the glViewPort by devicePixelRatio()

This fixes an issue seen in Cabana on a "hidpi" system with Wayland where
devicePixelRatio() != 1 and the video doesn't take up the full widget area.

On the recommended Ubuntu 20.04 install I wasn't able to reproduce, because
devicePixelRatio() was always equal to 1 even with scaling to 200% or 300%. It
might be different if "Fractional Scaling" is enabled in GNOME (I couldn't make
that option work in mv WM.)

Was going to enable just for Linux, but it appears to also be recommended for
Retina MacOS:
https://doc.qt.io/qt-5/scalability.html#high-dpi-scaling-on-macos-and-ios

... so have worked from the assumption that glViewport() always takes dimensions
in device pixels, never the "device independent pixels" of Qt.

* Update selfdrive/ui/qt/widgets/cameraview.cc

* Update selfdrive/ui/qt/widgets/cameraview.cc

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-19 11:06:54 -07:00
..
2023-03-08 11:20:49 -08:00
2023-04-18 23:27:49 -07:00
2020-01-17 11:03:42 -08:00
2023-03-08 11:20:49 -08:00