and use this to determine whether a legend item needs updating
as a result of a map change
This results in a HUGE speed up when loading large projects where
symbols don't use Millimeter based sizes, as the previous code
assumed only that any non-millimeter size was a map unit based size.
While it was possible to set the opacity for individual symbol layer
colors via data defined expressions, it's so far been impossible to
set a data defined expression to control the overall symbol opacity.
This commit fixes that omission...
Any fill symbol layer which supports offsetting polygons (i.e. simple
fills, raster image fills, shapeburst and gradent fills) now allows
for data-defined offsets
in simple line symbol layers
New options are:
- Align dash pattern to line length: If checked, the dash pattern lengths
will be subtely adjusted in order to ensure that when a line is rendered
it will end with a complete dash element, instead of a gap element or
partial dash element
- Tweak dash pattern at sharp corners: If checked, this option dynamically
adjusts the dash pattern placement so that sharp corners are represented
by a full dash element coming into and out of the sharp corner. It's designed
to better represent the underlying geometry while rendering dashed lines,
especially for jagged lines
by a preset amount
Allows for tweaking the positioning of dashes/spaces in the line, so
that the dashes/spaces can be placed at nicer positions to account
for corners in the line (also can be used potentially to "align"
adjacent dash pattern borders)
Offset can be set in different units, including map units, and can
be data defined
This avoids the force conversion to a raster based pattern which currently occurs
when exporting maps/layouts to a vector format (e.g. PDF). The raster pattern
results in considerable quality loss, and the tiling edges of the raster brush
can sometimes be seen in outputs.
Additionally, fixes render corrupt when marker subsymbols have data defined properties
which affect the marker shape, such as data defined rotation or sizes
Refs #16100 (still needs fixing for line fill symbols)
and preparation stage from the symbol layer rendering stage, and
ensure that QgsSymbolLayer::startFeatureRender and ::stopFeatureRender
is correctly called in the right sequence when rendering multi-layer
symbols
This fixes issues with symbol layers which rely on startFeatureRender
and stopFeatureRender to correctly render, e.g. the Random Marker Fill
symbol layer.
Before this fix, the logic looked like:
- for every symbol layer in the symbol, call startFeatureRender
- for each part in polygon, prepare the part geometry and then render each symbol layer
- for every symbol layer in the symbol, call stopFeatureRender
The issue with this approach is that symbol layers which defer
rendering to the stopFeatureRender stage are always rendered
after ALL other symbol layers in the symbol, regardless of the actual
order of the symbol layers. Ultimately this causes Random Marker Fill
layers to always render on the top of symbols.
The new logic is:
- for each part in polygon, prepare the geometry and store the result
- for each symbol layer in the symbol:
- call startFeatureRender
- render the layer using each of the previously prepared parts
- call stopFeatureRender
This results in correct stacking of the random marker fill in multi
layer symbols, because the stopFeatureRender call is correctly called
before the next layer's startFeatureRender and renderPolygon calls
Also, use QVector instead of QList for rings for improved efficiency
Introduce a renderer for 1D mesh edges that can vary width over the line. The line can also have different color based on the actual dataset value on the line's point.
Co-authored-by: Peter Petrik <zilolv@gmail.com>