Skip to content
Permalink
Browse files

Test updates

  • Loading branch information
nyalldawson committed Jul 11, 2020
1 parent 28c8eef commit c7ef8c8305400a09e375a21a127c4f115f9be784
Showing with 27 additions and 2 deletions.
  1. +8 −0 python/core/auto_generated/symbology/qgsfillsymbollayer.sip.in
  2. +11 −1 src/core/symbology/qgsfillsymbollayer.cpp
  3. +8 −1 src/core/symbology/qgsfillsymbollayer.h
  4. BIN ...estdata/control_images/adjacent_tiles/expected_adjacent_line_fill/expected_adjacent_line_fill.png
  5. BIN ...ta/control_images/adjacent_tiles/expected_adjacent_line_fill/expected_adjacent_line_fill_mask.png
  6. BIN ...ata/control_images/adjacent_tiles/expected_adjacent_marker_fill/expected_adjacent_marker_fill.png
  7. BIN ...ontrol_images/adjacent_tiles/expected_adjacent_marker_fill/expected_adjacent_marker_fill_mask.png
  8. BIN .../control_images/symbol_linefill/expected_datadefined_subsymbol/expected_datadefined_subsymbol.png
  9. BIN ...rol_images/symbol_linefill/expected_datadefined_subsymbol/expected_datadefined_subsymbol_mask.png
  10. BIN tests/testdata/control_images/symbol_linefill/expected_symbol_linefill/expected_symbol_linefill.png
  11. BIN ...estdata/control_images/symbol_linefill/expected_symbol_linefill/expected_symbol_linefill_mask.png
  12. BIN ...ol_linefill/expected_symbol_linefill_large_negoffset/expected_symbol_linefill_large_negoffset.png
  13. BIN ...ol_linefill/expected_symbol_linefill_large_posoffset/expected_symbol_linefill_large_posoffset.png
  14. BIN ...ol_images/symbol_linefill/expected_symbol_linefill_negangle/expected_symbol_linefill_negangle.png
  15. BIN ..._images/symbol_linefill/expected_symbol_linefill_negoffset/expected_symbol_linefill_negoffset.png
  16. BIN ..._images/symbol_linefill/expected_symbol_linefill_posoffset/expected_symbol_linefill_posoffset.png
  17. BIN ...ta/control_images/symbol_pointpatternfill/expected_symbol_pointfill/expected_symbol_pointfill.png
  18. BIN ...ntrol_images/symbol_pointpatternfill/expected_symbol_pointfill/expected_symbol_pointfill_mask.png
  19. BIN ...ges/symbol_pointpatternfill/expected_symbol_pointfill_offset/expected_symbol_pointfill_offset.png
  20. BIN ...ymbol_pointpatternfill/expected_symbol_pointfill_offset/expected_symbol_pointfill_offset_mask.png
@@ -759,6 +759,13 @@ Returns the stroke width map unit scale.
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
%Docstring
Custom stroke
%End

virtual bool applyBrushTransformFromContext() const;
%Docstring
Returns ``True`` if the image brush should be transformed using the render context's texture origin.

.. versionadded:: 3.16
%End

private:
@@ -1041,6 +1048,7 @@ Returns the map unit scale for the image's width.

virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );

virtual bool applyBrushTransformFromContext() const;

};

@@ -1597,7 +1597,7 @@ void QgsImageFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVec
p->setPen( QPen( Qt::NoPen ) );

QTransform bkTransform = mBrush.transform();
if ( !context.renderContext().textureOrigin().isNull() )
if ( applyBrushTransformFromContext() && !context.renderContext().textureOrigin().isNull() )
{
QPointF leftCorner = context.renderContext().textureOrigin();
QTransform t = mBrush.transform();
@@ -1751,6 +1751,11 @@ bool QgsImageFillSymbolLayer::hasDataDefinedProperties() const
return false;
}

bool QgsImageFillSymbolLayer::applyBrushTransformFromContext() const
{
return true;
}


//QgsSVGFillSymbolLayer

@@ -4171,6 +4176,11 @@ void QgsRasterFillSymbolLayer::applyDataDefinedSettings( QgsSymbolRenderContext
applyPattern( mBrush, file, width, opacity, context );
}

bool QgsRasterFillSymbolLayer::applyBrushTransformFromContext() const
{
return false;
}

void QgsRasterFillSymbolLayer::applyPattern( QBrush &brush, const QString &imageFilePath, const double width, const double alpha, const QgsSymbolRenderContext &context )
{
QSize size;
@@ -710,6 +710,13 @@ class CORE_EXPORT QgsImageFillSymbolLayer: public QgsFillSymbolLayer

virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context ) { Q_UNUSED( context ) }

/**
* Returns TRUE if the image brush should be transformed using the render context's texture origin.
*
* \since QGIS 3.16
*/
virtual bool applyBrushTransformFromContext() const;

private:
#ifdef SIP_RUN
QgsImageFillSymbolLayer( const QgsImageFillSymbolLayer &other );
@@ -922,7 +929,7 @@ class CORE_EXPORT QgsRasterFillSymbolLayer: public QgsImageFillSymbolLayer
protected:

void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;

bool applyBrushTransformFromContext() const override;
private:

//! Path to the image file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit c7ef8c8

Please sign in to comment.
You can’t perform that action at this time.