comparison layer/PaintAssistant.h @ 1228:dc6457ac4d07

Add method to scale pen widths for hi-res screens
author Chris Cannam
date Thu, 26 Jan 2017 21:17:19 +0000
parents ee01a4062747
children a34a2a25907c
comparison
equal deleted inserted replaced
1227:a8e126fe6a53 1228:dc6457ac4d07
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef PAINT_ASSISTANT_H 16 #ifndef SV_PAINT_ASSISTANT_H
17 #define PAINT_ASSISTANT_H 17 #define SV_PAINT_ASSISTANT_H
18 18
19 #include <QRect> 19 #include <QRect>
20 #include <QPen>
20 #include <vector> 21 #include <vector>
21 22
22 class QPainter; 23 class QPainter;
23 class Layer; 24 class Layer;
24 class LayerGeometryProvider; 25 class LayerGeometryProvider;
44 }; 45 };
45 46
46 static void drawVisibleText(const LayerGeometryProvider *, 47 static void drawVisibleText(const LayerGeometryProvider *,
47 QPainter &p, int x, int y, 48 QPainter &p, int x, int y,
48 QString text, TextStyle style); 49 QString text, TextStyle style);
50
51 /**
52 * Scale up pen width for a hi-dpi display without pixel doubling.
53 * Very similar to ViewManager::scalePixelSize, but a bit more
54 * conservative.
55 */
56 static double scalePenWidth(double width);
57
58 /**
59 * Apply scalePenWidth to a pen.
60 */
61 static QPen scalePen(QPen pen);
49 }; 62 };
50 63
51 #endif 64 #endif