Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update tests
  • Loading branch information
nyalldawson committed Oct 22, 2021
1 parent afd2154 commit a4c61f0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/symbology/qgsfillsymbollayer.cpp
Expand Up @@ -3558,6 +3558,10 @@ void QgsPointPatternFillSymbolLayer::renderPolygon( const QPolygonF &points, con
_renderPolygon( p, points, rings, context );
}

// if invalid parameters, skip out
if ( qgsDoubleNear( width, 0 ) || qgsDoubleNear( height, 0 ) || width < 0 || height < 0 )
return;

p->save();

QPainterPath path;
Expand Down
4 changes: 4 additions & 0 deletions tests/src/core/testqgspointpatternfillsymbol.cpp
Expand Up @@ -161,9 +161,13 @@ void TestQgsPointPatternFillSymbol::pointPatternFillSymbolVector()
QgsMarkerSymbol *pointSymbol = QgsMarkerSymbol::createSimple( properties );

mPointPatternFill->setSubSymbol( pointSymbol );
mPointPatternFill->setDistanceX( 10 );
mPointPatternFill->setDistanceY( 10 );
mMapSettings.setFlag( Qgis::MapSettingsFlag::ForceVectorOutput, true );
const bool res = imageCheck( "symbol_pointfill_vector" );
mMapSettings.setFlag( Qgis::MapSettingsFlag::ForceVectorOutput, false );
mPointPatternFill->setDistanceX( 15 );
mPointPatternFill->setDistanceY( 15 );
QVERIFY( res );

// also confirm that output is indeed vector!
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a4c61f0

Please sign in to comment.