File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -6808,6 +6808,10 @@ void QgisApp::copyStyle( QgsMapLayer * sourceLayer )
6808
6808
rootNode.setAttribute ( " version" , QString ( " %1" ).arg ( QGis::QGIS_VERSION ) );
6809
6809
doc.appendChild ( rootNode );
6810
6810
6811
+ rootNode.setAttribute ( " hasScaleBasedVisibilityFlag" , selectionLayer->hasScaleBasedVisibility () ? 1 : 0 );
6812
+ rootNode.setAttribute ( " minimumScale" , QString::number ( selectionLayer->minimumScale () ) );
6813
+ rootNode.setAttribute ( " maximumScale" , QString::number ( selectionLayer->maximumScale () ) );
6814
+
6811
6815
/*
6812
6816
* Check to see if the layer is vector - in which case we should also copy its geometryType
6813
6817
* to avoid eventually pasting to a layer with a different geometry
@@ -6889,6 +6893,10 @@ void QgisApp::pasteStyle( QgsMapLayer * destinationLayer )
6889
6893
return ;
6890
6894
}
6891
6895
6896
+ selectionLayer->setScaleBasedVisibility ( rootNode.attribute ( " hasScaleBasedVisibilityFlag" ).toInt () == 1 );
6897
+ selectionLayer->setMinimumScale ( rootNode.attribute ( " minimumScale" ).toFloat () );
6898
+ selectionLayer->setMaximumScale ( rootNode.attribute ( " maximumScale" ).toFloat () );
6899
+
6892
6900
mLayerTreeView ->refreshLayerSymbology ( selectionLayer->id () );
6893
6901
mMapCanvas ->clearCache ();
6894
6902
mMapCanvas ->refresh ();
You can’t perform that action at this time.
0 commit comments