Bug report #13078
Size of legend items
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21146|
The legend looks ugly if i use map units in symbology.
It looks very good in < 2.10.
Fix legend symbol size when using map units
The computation of icon sizes for legend symbols has been moved to
QgsLayerTreeModel::legendInvalidateMapBasedData() susch that icon size
is recomputed when zooming.
#6 Updated by Vincent Mora over 4 years ago
Nyall, it definitely looks like that, but I wasn't able to open the project when I tried (I think I forgot the symbols or something). I'm on a vacation at the moment, but I'll try and have a look asap.
Holger, what happens if you use mm instead of map units, does it look better, does the zoom level change anything ?
#9 Updated by Vincent Mora over 4 years ago
Nyall, I have a lead: when QgsSymbolV2LegendNode::minimumIconSize is called by QgsDefaultVectorLayerLegend::createLayerTreeModelLegendNodes, the model() is null, whereas it is not when QgsSymbolV2LegendNode::data() is called with decoration rôle.
For what I understand, it's a matter of setting the correct parent for the node in createLayerTreeModelLegendNodes. If you or Matthias could give me a hint, I'd be gratefull.
#14 Updated by Nyall Dawson over 4 years ago
Please note that the scaling of legend shapes in composer legends is intentional and is the same beahviour as previous versions. So that's not an issue.
However, it seems like the size of the legend isn't calculated correctly on composer load when the legend contains shape sizes in map units - the legend is set to a massive width & height. Forcing a refresh of the legend fixes the size.