Fix of HighDPI rendering
In response to issue https://gitlab.vci.rwth-aachen.de:9000/OpenFlipper-Free/OpenFlipper/-/issues/28 I propose following fix:
- make glViewer aware of device pixel ratio and incorporate dpr into viewport size/offset calculation
Below is a recording of the fix running on my machine.
DPR scaling set to 2
and 1
to demonstrate no breaking changes for regular screens.
Todo: Requires verification on high-dpi screens
(double click for full resolution)
Merge request reports
Activity
assigned to @moebius
Nice, can't wait to have proper HiDPI support :-)
However I think we need to get the
devicePixelRatio
dynamically and not just on viewer construction, Qt docs state it can change, e.g. when moving a window between screens:added 1 commit
- 9a4578b9 - grabs current screen by QGraphicsWidget center and adapts dpi acoordingly....
added 6 commits
- be477da9 - moves devicepixelratio to viewerproperties, where it can be accessed from any...
- 9b0b5868 - changes scene()-> width/height by wrapper which already takes DPR into account
- 90256396 - adds convenience wrapper for scene resolution and position
- c5fd722d - adds convenience wrapper for scene resolution and position and introduce their usage everywhere
- f9148eb2 - introduces converter from regular pixel coordinates to DPR adjusted coordinates
- 8e4f4c26 - introduces converter from regular pixel coordinates to DPR adjusted coordinates
Toggle commit listChanges:
- current devicepixelratio lives in viewproperties
- can be used by any plugin by being exposed via PluginFunctions::adjustForDevicePixelRatio on any mouse event position
- fixes broken selection and rendering (see recording) (respective merge requests are open)
todo: fix all other occurences of direct mouse click position usage
Edited by Zain Selman- current devicepixelratio lives in viewproperties
moved out the conversion of all endpoints and plugins and moved it to
Core::slotMouseEvent
, where all plugins etc get their mouseevents from. contextmenu had to be done manually as it does not recieve its mouseevent fromCore::slotMouseEvent
. no changes in the plugins should be required- Resolved by Zain Selman
- Resolved by Zain Selman
- Resolved by Jan Möbius
- Resolved by Jan Möbius
- Resolved by Jan Möbius
- Resolved by Zain Selman
- Resolved by Zain Selman