Bug report #13078
Size of legend items
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Vincent Mora | ||
Category: | Symbology | ||
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 |
Description
The legend looks ugly if i use map units in symbology.
It looks very good in < 2.10.
Related issues
Associated revisions
Fix legend symbol size when using map units
fix #13078
The computation of icon sizes for legend symbols has been moved to
QgsLayerTreeModel::legendInvalidateMapBasedData() susch that icon size
is recomputed when zooming.
History
#1 Updated by Nyall Dawson over 9 years ago
Can you share your project?
#2 Updated by Giovanni Manghi over 9 years ago
- Status changed from Open to Feedback
#3 Updated by Holger Naumann over 9 years ago
- File projekt.zip added
- File punktsymbole.zip added
- File style.zip added
No problem.
#4 Updated by Nyall Dawson over 9 years ago
- Assignee set to Vincent Mora
Vincent - looks related to your legend related changes, mind taking a look?
#5 Updated by Giovanni Manghi about 9 years ago
- Status changed from Feedback to Open
#6 Updated by Vincent Mora about 9 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 ?
#7 Updated by Holger Naumann about 9 years ago
- File example.png added
Hi Vincent,
if units are in mm, it is ok. But if one symbol is in mapunits, legend is broken.
#8 Updated by Vincent Mora about 9 years ago
Hi Holger,
Thanks for the update. The thing that seems to be broken seems to be the cropping of the symbol, the symbol size is right but the symbol takes way to much place. I'll have a look asap.
#9 Updated by Vincent Mora about 9 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.
#10 Updated by Nyall Dawson about 9 years ago
Vmora - Martin will be the one to contact about this, he's got the most knowledge of how the legends work...
#11 Updated by Vincent Mora about 9 years ago
- Pull Request or Patch supplied changed from No to Yes
The fix is here https://github.com/qgis/QGIS/pull/2245
Holger: thanks for the report.
Martin: thanks for the pointers.
#12 Updated by Martin Dobias about 9 years ago
- Status changed from Open to Closed
Fixed in changeset 7d1a8d30199e2b6bf2669478f474c0911d04f6b1.
#13 Updated by Holger Naumann about 9 years ago
- Status changed from Closed to Reopened
- File Bildschirmfoto_von_»2015-08-24_13-01-43«.png added
Hi Vincent, the problem is solved in the mapwindow. But in print composer, the problem exist.
#14 Updated by Nyall Dawson about 9 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.
#15 Updated by Nyall Dawson about 9 years ago
- Status changed from Reopened to Closed
Actually - that's a unrelated issue. Closing this.