@@ -91,7 +91,7 @@ QgsMarkerCatalogue *QgsMarkerCatalogue::instance()
91
91
return QgsMarkerCatalogue::mMarkerCatalogue ;
92
92
}
93
93
94
- QImage QgsMarkerCatalogue::imageMarker ( QString fullName, int size, QPen pen, QBrush brush, bool qtBug )
94
+ QImage QgsMarkerCatalogue::imageMarker ( QString fullName, double size, QPen pen, QBrush brush, bool qtBug )
95
95
{
96
96
97
97
//
@@ -100,15 +100,15 @@ QImage QgsMarkerCatalogue::imageMarker ( QString fullName, int size, QPen pen, Q
100
100
QImage myImage;
101
101
if ( fullName.left (5 ) == " hard:" )
102
102
{
103
- myImage = QImage (size, size, QImage::Format_ARGB32_Premultiplied);
103
+ myImage = QImage (size + 1 , size + 1 , QImage::Format_ARGB32_Premultiplied);
104
104
}
105
105
else
106
106
{
107
107
// TODO Change this logic so width is size and height is same
108
108
// proportion of scale factor as in oritignal SVG TS XXX
109
109
if (size < 1 ) size=1 ;
110
110
// QPixmap myPixmap = QPixmap(width,height);
111
- myImage = QImage (size,size, QImage::Format_ARGB32_Premultiplied);
111
+ myImage = QImage (size ,size , QImage::Format_ARGB32_Premultiplied);
112
112
}
113
113
114
114
// starting with transparent QImage
@@ -141,7 +141,7 @@ QImage QgsMarkerCatalogue::imageMarker ( QString fullName, int size, QPen pen, Q
141
141
return QImage (); // empty
142
142
}
143
143
144
- QPicture QgsMarkerCatalogue::pictureMarker ( QString fullName, int size, QPen pen, QBrush brush, bool qtBug )
144
+ QPicture QgsMarkerCatalogue::pictureMarker ( QString fullName, double size, QPen pen, QBrush brush, bool qtBug )
145
145
{
146
146
147
147
//
@@ -182,42 +182,42 @@ QPicture QgsMarkerCatalogue::pictureMarker ( QString fullName, int size, QPen pe
182
182
return QPicture (); // empty
183
183
}
184
184
185
- void QgsMarkerCatalogue::svgMarker ( QPainter * thepPainter, QString filename, int scaleFactor)
185
+ void QgsMarkerCatalogue::svgMarker ( QPainter * thepPainter, QString filename, double scaleFactor)
186
186
{
187
187
QSvgRenderer mySVG;
188
188
mySVG.load (filename);
189
189
mySVG.render (thepPainter);
190
190
}
191
191
192
- void QgsMarkerCatalogue::hardMarker (QPainter * thepPainter, QString name, int s, QPen pen, QBrush brush, bool qtBug )
192
+ void QgsMarkerCatalogue::hardMarker (QPainter * thepPainter, QString name, double s, QPen pen, QBrush brush, bool qtBug )
193
193
{
194
194
// Size of polygon symbols is calculated so that the boundingbox is circumscribed
195
195
// around a circle with diameter mPointSize
196
196
197
- int half = s/2 ; // number of points from center
197
+ double half = s/2 ; // number of points from center
198
198
199
199
QgsDebugMsg (QString (" Hard marker size %1" ).arg (s));
200
200
201
201
// Find out center coordinates.
202
- int x_c = s/2 ;
203
- int y_c = x_c;
202
+ double x_c = s/2 ;
203
+ double y_c = x_c;
204
204
205
205
// Picture
206
206
QPicture picture;
207
207
thepPainter->begin (&picture);
208
208
thepPainter->setRenderHint (QPainter::Antialiasing);
209
209
210
210
// Also width must be odd otherwise there are discrepancies visible in canvas!
211
- int lw = ( int )(2 *floor ((double )pen.width ()/2 )+1 ); // -> lw > 0
212
- pen.setWidth (lw);
211
+ double lw = pen. widthF (); // ( int)(2*floor((double)pen.widthF ()/2)+1); // -> lw > 0
212
+ pen.setWidthF (lw);
213
213
thepPainter->setPen ( pen );
214
214
thepPainter->setBrush ( brush);
215
215
QRect box;
216
216
217
217
// Circle radius, is used for other figures also, when compensating for line
218
218
// width is necessary.
219
219
220
- int r = (s-2 *lw)/2 -1 ;
220
+ double r = (s-2 *lw)/2 -1 ;
221
221
QgsDebugMsg (QString (" Hard marker radius %1" ).arg (r));
222
222
223
223
if ( name == " circle" )
0 commit comments