Skip to content
Snippets Groups Projects

Fix of HighDPI rendering

Merged Zain Selman requested to merge zs/highdpi_fix_maybe into master

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)

fix

Edited by Jan Möbius

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1117 1116
1118 1117 void glViewer::resizeEvent(QGraphicsSceneResizeEvent *)
1119 1118 {
1119 const auto ratio = QGuiApplication::screens()[0]->devicePixelRatio();
  • Zain Selman added 1 commit

    added 1 commit

    • 9a4578b9 - grabs current screen by QGraphicsWidget center and adapts dpi acoordingly....

    Compare with previous version

  • Zain Selman added 6 commits

    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

    Compare with previous version

  • Author Developer

    out

    Changes:

    • 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
  • Zain Selman added 1 commit

    added 1 commit

    Compare with previous version

  • Zain Selman added 1 commit

    added 1 commit

    Compare with previous version

  • Zain Selman added 2 commits

    added 2 commits

    • 26df9880 - adds convenience wrapper adjusting of DPR
    • db84c464 - moves recalc of cursor pose up into Core.cc. so far only the context menu does...

    Compare with previous version

  • Author Developer

    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 from Core::slotMouseEvent. no changes in the plugins should be required

  • Jan Möbius
  • Jan Möbius
  • Jan Möbius
  • Jan Möbius
  • Jan Möbius
  • Jan Möbius
  • Jan Möbius
  • Zain Selman added 4 commits

    added 4 commits

    • 1805f67b - adds recalc for mousewheel, PluginMouseEventLight
    • 6958b148 - adds method for QPointF as well
    • 518bdc91 - adds method for QPointF as well
    • d5a9f5bc - removes unused parameters

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading