Skip to content

Commit

Permalink
Merge pull request #524 from wawuwo/fix-grid-points-size-on-hidpi-dis…
Browse files Browse the repository at this point in the history
…play

Fix poor grid appearence on HiDPI displays
  • Loading branch information
ra3xdh authored Feb 4, 2024
2 parents 87629eb + 1de5336 commit bca09c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qucs/schematic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,14 @@ void Schematic::drawGrid(const ViewPainter& p)
if (!GridOn)
return;

// A grid drawn with pen of 1.0 width reportedly looks good both
// on standard and HiDPI displays.
// See here for details https://github.com/ra3xdh/qucs_s/pull/524
p.Painter->setPen(QPen{ Qt::black, 1.0 });

{
// Draw small cross at origin of coordinates
const QPoint origin = contentsToViewport(modelToView(QPoint{0, 0}));
p.Painter->setPen(QPen(Qt::black, 0));
p.Painter->drawLine(origin.x() - 3, origin.y(), origin.x() + 4, origin.y()); // horizontal stick
p.Painter->drawLine(origin.x(), origin.y() - 3, origin.x(), origin.y() + 4); // vertical stick
}
Expand Down

0 comments on commit bca09c2

Please sign in to comment.