summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-27 16:07:06 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-27 16:11:33 (GMT)
commita50d67340bf1ae9314e7c27eb23506d21e1277e7 (patch)
tree0b6a1220af1ed2203a2573cd81c9eb73f81a5c3f
parentfb24641f79c48609c6dcc879f55184447e4b23b7 (diff)
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
-rw-r--r--src/lib/marble/GeoPainter.cpp4
-rw-r--r--src/lib/marble/GeoPainter.h2
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/marble/GeoPainter.cpp b/src/lib/marble/GeoPainter.cpp
index 2ba7dcd..1dbc133 100644
--- a/src/lib/marble/GeoPainter.cpp
+++ b/src/lib/marble/GeoPainter.cpp
@@ -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 );
diff --git a/src/lib/marble/GeoPainter.h b/src/lib/marble/GeoPainter.h
index 6239c9e..27d93a7 100644
--- a/src/lib/marble/GeoPainter.h
+++ b/src/lib/marble/GeoPainter.h
@@ -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").
diff --git a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
index c7bdd52..163e02f 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
@@ -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();