Skip to content
Commit ae7ac56e authored by Dennis Nienhüser's avatar Dennis Nienhüser
Browse files

More flexible rendering order in GeometryLayer/GeoGraphicsScene

The Vector OSM map theme has some rendering order problems right now
that result in some item combinations to look odd. This patch provides
a more fine-granular control of the rendering order. It also refactors
the decorators previously used and merges them into that approach.

Extend paint() of GeographicsItem to take another argument, a string
layer
Each GeographicsItem specifies a list of such layers it wants to paint
GeometryLayer defines the order of layers and paints them that way
E.g. currently a highway behaves like this:

GeoLineStringItem is created, and internally creates a copy of itself
which is its decorator, assigns a z-value
GeometryLayer queries all decorators during paint, sorts them by z-value
GeoLineStringItem tests whether it is a decorator during painting,
changes rendering based on that
The patch changes this to

GeoLineStringItem is created and asks for three layers to be rendered:
.../outline, .../inline and .../label
GeometryLayer queries all layers during paint, sorts them by render
order
GeoLineStringItem changes rendering based on the provided layer name
This avoids having to treat decorators as special and duplicated items
internally, and also allows an important render order behavior change:
It is now possible to render e.g. all visible streets first and all
their labels afterwards. Previously it was only possible to render one
street after the other, so e.g. the second street could overpaint the
label of the first.

Projects: #marble

Differential Revision: https://phabricator.kde.org/D1181
parent 5ddef264
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment