Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Bring feature order and rendering order together in a useful way
There are two ways of taking "order" into account when rendering: 1. You can control the feature rendering order which essentially does an "order by" of your layer data. 2. You can enable symbol levels which defines which styles are rendered in which order. This commit addresses a problem when trying to bring (1) and (2) together. When both are enabled, the rendering order (2) trumps the order given by (1), essentially ignoring the order from (1). With this commit rendering instead starts "from scratch" every time the "order by" attributes have a new value. This allows, for instance, to render complex roads networks correctly. Ordering via (1) is used to draw roads going over bridges etc. in the correct order while ordering via (2) is used to render road styles correctly (thicker dark line, then thinner light line to get a roads with casing). The patch works by putting all features that need to be rendered not in a single QHash (Symbol->Feature) but a QList of those hashes. Every time at least one of the attributes used for the "order by" changes, a new element is added to that list. The patch is rather simple, it just looks a bit larger due to the extra indentation needed. I thought about making this configurable, but I don't see any use case where it makes sense to have (1) and (2) enabled where you don't want this behaviour. Fixes #42428 See #17276
- Loading branch information
Showing
1 changed file
with
85 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters