Bug report #7061

Incorrect rendering of dash pattern with zero-length dash for thin lines

Added by J. Dugge about 11 years ago. Updated about 5 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:16146

Description

A custom dash pattern that includes an entry with a Dash length of zero is rendered incorrectly when the Pen width is below some threshold. Single dots appear in the line, and the length of the dashes is no longer uniform. Increasing the Pen width past some threshold makes the behaviour disappear.

To reproduce: Select a vector layer, edit the Style, change the Symbol Properties, add an "Outline: Simple line" Symbol layer, check "Use custom dash pattern", set the dash pattern to the following:
Dash Space
0 2.5
5 2.5

For me, the Symbol preview shows an incorrect dash pattern for Pen widths up to 0.26458. If I set the Pen width to 0.26459 or higher, the dash pattern is correct.

Dash patterns of this kind (with an entry with a zero-length dash) are useful to work around the missing phase shift / dash pattern offset feature, as required for example here: http://gis.stackexchange.com/questions/48554/qgis-line-style

12.png - Incorrect dash pattern (40.8 KB) J. Dugge, 2013-01-28 07:09 AM

26.png - Correct dash pattern (40.7 KB) J. Dugge, 2013-01-28 07:09 AM

History

#1 Updated by Anita Graser over 8 years ago

  • Priority changed from Normal to Low

I don't think there's actually a bug here. The points you see are caused by the square cap style. They should vanish if you change that to flat.

#2 Updated by Nyall Dawson over 8 years ago

Dash patterns of this kind (with an entry with a zero-length dash) are useful to work around the missing phase shift / dash pattern offset feature, as required for example here: http://gis.stackexchange.com/questions/48554/qgis-line-style

Just FYI - marker line styles have an initial offset option since about 2.6 (maybe 2.4... I can't exactly recall)

#3 Updated by J. Dugge over 8 years ago

Anita Graser wrote:

The points you see are caused by the square cap style. They should vanish if you change that to flat.

Changing the cap style to flat does not solve the problem, the dots appear regardless of the cap style (tested in QGIS nightly cc18882).


Nyall Dawson wrote:

Just FYI - marker line styles have an initial offset option since about 2.6 (maybe 2.4... I can't exactly recall)

Thanks for the info. Unfortunately, that option doesn't exist for dash patterns in simple line styles, so it doesn't solve this particular problem.

#4 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#5 Updated by Giovanni Manghi about 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF