Bug report #21092
Marker line with custom dash
|Affected QGIS version:||3.4.4||Regression?:||No|
|Operating System:||Win 10||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||28910|
Rendering of comlex line symbol ( marker line with custom dash line ) show different incorrect results on different scales. See examples on the pictures. "Scale 1:500" shows correct rendering. Position of marker match the gap of dashed line. "Scale 1:250" - line cross the symbol. "Scale 1:10000" - wrong symbol size. Size of symbol is set in map units. With this scale it must be one pixel only or invisible. I see this problem in both QGIS 2.18 and 3.4 versions.
#4 Updated by Sergey Chernyshov almost 2 years ago
I see the problem is because rendering uses different algorythmes for draw Marker line and Simple line with Custom dash pattern.
For Marker line I set Marker placement parameter = "with interval" and Units for this interval are "Map units". Rendering algorythm calculates position of each markers from the beginning of line.
I expected the the same algorythm for dashed line. But it differs!
Pen object uses Custom Dash Pattern (qgslinesymbollayerv2.cpp):
mPen.setStyle( Qt::CustomDashLine );
mPen.setDashPattern( scaledVector );
Then beninning of dashes / spaces depends on current visible frame, visible part of feature, etc.
#7 Updated by Sergey Chernyshov almost 2 years ago
Alexis Roy-L wrote:
Did some tests, on my end, only font marker seem to behave this way. Typical symbols and SVGs are ok and maintain their scale when zoomed out.
The problem is with custom dashes and spaces (in map units!). In my tests all types of symbol were rendered correct.