summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-10 18:47:32 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-10 18:47:32 (GMT)
commit80c3aa76823727b1a48307064889830b2a85fb59 (patch)
tree14324015cb8f5620b4bc62804f73a804d1418065
parentbc1ce46fdabb0b30459cb1f7cda9fe225fa798ab (diff)
Don't attempt to draw empty labels.
-rw-r--r--src/lib/marble/GeoPainter.cpp3
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/marble/GeoPainter.cpp b/src/lib/marble/GeoPainter.cpp
index e7f5f1c..006be7c 100644
--- a/src/lib/marble/GeoPainter.cpp
+++ b/src/lib/marble/GeoPainter.cpp
@@ -599,6 +599,9 @@ void GeoPainter::drawLabelsForPolygons( const QVector<QPolygonF*> &polygons,
LabelPositionFlags labelPositionFlags,
const QColor& labelColor )
{
+ if (labelText.isEmpty()) {
+ return;
+ }
QPen const oldPen = pen();
if (labelPositionFlags.testFlag(FollowLine)) {
diff --git a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
index c2c7738..8602a69 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
@@ -38,7 +38,9 @@ GeoLineStringGraphicsItem::GeoLineStringGraphicsItem(const GeoDataPlacemark *pla
QStringList paintLayers;
paintLayers << QLatin1String("LineString/") + category + QLatin1String("/outline");
paintLayers << QLatin1String("LineString/") + category + QLatin1String("/inline");
- paintLayers << QLatin1String("LineString/") + category + QLatin1String("/label");
+ if (!feature()->name().isEmpty()) {
+ paintLayers << QLatin1String("LineString/") + category + QLatin1String("/label");
+ }
setPaintLayers(paintLayers);
}