# HG changeset patch # User Chris Cannam # Date 1430309297 -3600 # Node ID 76b5eabd816b97c9777e785fb46a784507c4c8ba # Parent 17cb48115d2248c8a917a86aa9e16a8317da52ab Fix font size for painter when rendering scaled diff -r 17cb48115d22 -r 76b5eabd816b view/View.cpp --- a/view/View.cpp Wed Apr 29 13:02:57 2015 +0100 +++ b/view/View.cpp Wed Apr 29 13:08:17 2015 +0100 @@ -1657,8 +1657,18 @@ void View::setPaintFont(QPainter &paint) { + int scaleFactor = 1; + int dpratio = devicePixelRatio(); + if (dpratio > 1) { + QPaintDevice *dev = paint.device(); + if (dynamic_cast(dev) || dynamic_cast(dev)) { + scaleFactor = dpratio; + } + } + QFont font(paint.font()); - font.setPointSize(Preferences::getInstance()->getViewFontSize()); + font.setPointSize(Preferences::getInstance()->getViewFontSize() + * scaleFactor); paint.setFont(font); }