[Qgis-developer] Legend refactoring - part II - ready for merge

Martin Dobias wonder.sk at gmail.com
Mon Aug 25 23:54:11 PDT 2014


Hi Tim!

On Sun, Aug 24, 2014 at 2:51 PM, Tim Sutton <tim at kartoza.com> wrote:
>
> Ah wow - I've been playing with it here and it is so much nicer from
> the UI point of view. Two things I picked up though.
>
> * I don't know how to reproduce it exactly but it seems that when I
> change the text for a layer name in general properties it updates the
> legend fine but after using QGIS a little more I notice that the layer
> name reverts to its previous state. I will post more details if I
> figure out how to replicate this.

If you will find the pattern how to reproduce it, feel free to report
an issue - glad to hear the bug is not caused by the refactoring
though :-)  (according to your latter mail)


> * Do you have any strategy for dealing with symbols larger than the
> thumbnail in the legend? e.g. if you set the size of a circle  to 8 it
> basically draws a square. This is not a regression as the old legend
> implementation suffered the same thing, but I was hoping a new
> implementation could offer a fix for this. I know there are limits to
> what we can do in the space of the legend but perhaps having some
> simple system whereby symbol previews are proportionally scaled such
> that the largest icon will always fit into the space provided and the
> smaller ones are relatively reduced in scale? Perhaps someone else has
> some creative ideas on how to improve their visual representation in
> the legend?

Yes this is still an issue. The legend icon in the layer tree has more
problems than just fixed maximum symbol size. It also ignores the fact
that some symbols may have size specified in map units and assumes
that one map unit == one millimeter. Moreover such legend entries
should be probably updated every time that map scale changes (which
may have a negative performance impact) or at least once upon a time.
But thanks to the refactoring it should be easier to address the
issue. In map composer legend, rendering of the legend is now done
correctly and the code for rendering of symbol icons for both layer
tree and composer (and WMS!) is now just in one class
(QgsSymbolV2LegendNode).

For a strategy with big symbols I would suggest (for a future implementation):
- have a default symbol icon size (as of now)
- allow symbol icons to become bigger up to some maximum icon size
- symbols bigger than maximum size would be scaled with a small note
underneath how much they are scaled (e.g. "1:5")

Cheers
Martin


More information about the Qgis-developer mailing list