From f4c1c56a1a0b7ea46bc86bce12ce4f3fdf19118e Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 2 Dec 2024 09:24:26 +1000 Subject: [PATCH] Fix cached re-renders of mesh layers drop mesh labels Eg when switching off a vector layer with labels, the labels from a mesh layer will not be rendered on the map redraw --- src/core/labeling/qgspallabeling.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/labeling/qgspallabeling.cpp b/src/core/labeling/qgspallabeling.cpp index c3b104a815aa..ecb22f13b963 100644 --- a/src/core/labeling/qgspallabeling.cpp +++ b/src/core/labeling/qgspallabeling.cpp @@ -58,6 +58,7 @@ #include "qgsvectortilebasiclabeling.h" #include "qgsfontmanager.h" #include "qgsvariantutils.h" +#include "qgsmeshlayer.h" using namespace pal; @@ -4088,9 +4089,14 @@ bool QgsPalLabeling::staticWillUseLayer( const QgsMapLayer *layer ) return false; } + case Qgis::LayerType::Mesh: + { + const QgsMeshLayer *ml = qobject_cast< const QgsMeshLayer * >( layer ); + return ml->labeling() && ml->labelsEnabled(); + } + case Qgis::LayerType::Raster: case Qgis::LayerType::Plugin: - case Qgis::LayerType::Mesh: case Qgis::LayerType::PointCloud: case Qgis::LayerType::Annotation: case Qgis::LayerType::Group: