diff layer/PaintAssistant.h @ 1324:13d9b422f7fe zoom

Merge from default branch
author Chris Cannam
date Mon, 17 Sep 2018 13:51:31 +0100
parents a34a2a25907c
children cca66ce390e0
line wrap: on
line diff
--- a/layer/PaintAssistant.h	Mon Dec 12 15:18:52 2016 +0000
+++ b/layer/PaintAssistant.h	Mon Sep 17 13:51:31 2018 +0100
@@ -13,10 +13,11 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef PAINT_ASSISTANT_H
-#define PAINT_ASSISTANT_H
+#ifndef SV_PAINT_ASSISTANT_H
+#define SV_PAINT_ASSISTANT_H
 
 #include <QRect>
+#include <QPen>
 #include <vector>
 
 class QPainter;
@@ -38,14 +39,26 @@
                             int minY, int height);
 
     enum TextStyle {
-	BoxedText,
-	OutlinedText,
+        BoxedText,
+        OutlinedText,
         OutlinedItalicText
     };
 
     static void drawVisibleText(const LayerGeometryProvider *,
                                 QPainter &p, int x, int y,
                                 QString text, TextStyle style);
+
+    /**
+     * Scale up pen width for a hi-dpi display without pixel doubling.
+     * Very similar to ViewManager::scalePixelSize, but a bit more
+     * conservative.
+     */
+    static double scalePenWidth(double width);
+
+    /**
+     * Apply scalePenWidth to a pen.
+     */
+    static QPen scalePen(QPen pen);
 };
 
 #endif