Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
1183:57d192e26331 | 1324:13d9b422f7fe |
---|---|
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; |
36 static int getYForValue(Scale scale, double value, | 37 static int getYForValue(Scale scale, double value, |
37 double minVal, double maxVal, | 38 double minVal, double maxVal, |
38 int minY, int height); | 39 int minY, int height); |
39 | 40 |
40 enum TextStyle { | 41 enum TextStyle { |
41 BoxedText, | 42 BoxedText, |
42 OutlinedText, | 43 OutlinedText, |
43 OutlinedItalicText | 44 OutlinedItalicText |
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 |