GeoPainter::drawPolyline: Use painter font property for labels, not some arg

Restores API dox claim and also consistency in the different code paths
of GeoPainter::drawPolyline
parent fb24641f
......@@ -549,7 +549,7 @@ QRegion GeoPainter::regionFromPixmapRect(const GeoDataCoordinates & centerCoordi
void GeoPainter::drawPolyline ( const GeoDataLineString & lineString,
const QString& labelText,
LabelPositionFlags labelPositionFlags,
const QColor& labelColor,const QFont& labelFont)
const QColor& labelColor)
{
// no labels to draw?
// TODO: !labelColor.isValid() || labelColor.alpha() == 0 does not work,
......@@ -592,7 +592,7 @@ void GeoPainter::drawPolyline ( const GeoDataLineString & lineString,
save();
if (fontSize >= 6.0) {
QFont font = labelFont;
QFont font = this->font();
font.setPointSizeF(fontSize);
setFont(font);
int labelWidth = fontMetrics().width( labelText );
......
......@@ -318,7 +318,7 @@ class MARBLE_EXPORT GeoPainter : public ClipPainter
void drawPolyline ( const GeoDataLineString & lineString,
const QString& labelText,
LabelPositionFlags labelPositionFlags = LineCenter,
const QColor& labelcolor = Qt::black, const QFont& labelFont = QFont(QLatin1String("Arial")));
const QColor& labelcolor = Qt::black);
/*!
\brief Draws a given line string (a "polyline").
......
......@@ -129,9 +129,9 @@ void GeoLineStringGraphicsItem::paintLabel(GeoPainter *painter, const ViewportPa
//painter->setBackground(QBrush(color));
//painter->setBackgroundMode(Qt::OpaqueMode);
const GeoDataLabelStyle& labelStyle = style->labelStyle();
painter->setFont(labelStyle.font());
painter->drawPolyline( *m_lineString, feature()->name(), FollowLine,
labelStyle.paintedColor(),
labelStyle.font());
labelStyle.paintedColor());
}
painter->restore();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment