Bug report #15728

line pattern fill symbology throws qpainter warnings when line space in map unit and canvas scaled out

Added by Mathieu Pellerin - nIRV about 8 years ago. Updated about 8 years ago.

Status:Closed
Priority:Normal
Assignee:Mathieu Pellerin - nIRV
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23650

Description

When the line pattern fill symbology uses map unit line spacing value and the scale forces the line spacing to effectively disappear, the symbology fails to render, and the following QPainter warnings are printed in the terminal:

Warning: QPainter::begin: Paint device returned engine == 0, type: 3
Warning: QPainter::setRenderHint: Painter must be active to set rendering hints
Warning: QPainter::setPen: Painter not active
Warning: QPainter::setBrush: Painter not active
Warning: QPainter::drawPath: Painter not active
Warning: QPainter::setPen: Painter not active
Warning: QPainter::setBrush: Painter not active
Warning: QPainter::drawPath: Painter not active
Warning: QPainter::end: Painter not active, aborted
Steps to reproduce
  1. Launch QGIS within a terminal to be able to see messages output there
  2. Open the attached test project (qpainter_warnings.qgs)
  3. Gradually zoom out the canvas, until you see the line pattern fill fail to render
  4. Go to the terminal window, you'll see the QPainter warning

qpainter_warnings.zip (6.22 KB) Mathieu Pellerin - nIRV, 2016-10-19 10:15 PM

Associated revisions

Revision 3212d393
Added by Mathieu Pellerin - nIRV about 8 years ago

[symbology] prevent creation of a zero width/height line pattern image (fixes #15728)

Revision 3bdc77d3
Added by Nyall Dawson about 8 years ago

Merge pull request #3645 from nirvn/linefillpattern_fix

[symbology] prevent creation of a zero width/height line pattern image (fixes #15728)

History

#1 Updated by Mathieu Pellerin - nIRV about 8 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Assignee set to Mathieu Pellerin - nIRV

#2 Updated by Nyall Dawson about 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF