mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Consider PR feedback
This commit is contained in:
parent
49cce29268
commit
e76ca64eae
@ -397,7 +397,7 @@ Write mtext (MTEXT)
|
||||
.. versionadded:: 2.15
|
||||
%End
|
||||
|
||||
static double mapUnitScaleFactor( double scaleDenominator, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits, double mapUnitsPerPixel = 1.0 );
|
||||
static double mapUnitScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits, double mapUnitsPerPixel = 1.0 );
|
||||
%Docstring
|
||||
Returns scale factor for conversion to map units
|
||||
|
||||
|
@ -999,7 +999,12 @@ void QgsDxfExport::writeEntities()
|
||||
continue;
|
||||
}
|
||||
|
||||
ctx.expressionContext().appendScope( QgsExpressionContextUtils::layerScope( ml ) );
|
||||
auto scopePopper = [&ctx]( QgsExpressionContextScope * scope )
|
||||
{
|
||||
delete ctx.expressionContext().popScope();
|
||||
};
|
||||
std::unique_ptr<QgsExpressionContextScope, decltype( scopePopper ) > layerScope( QgsExpressionContextUtils::layerScope( ml ), scopePopper );
|
||||
ctx.expressionContext().appendScope( layerScope.get() );
|
||||
QgsSymbolRenderContext sctx( ctx, QgsUnitTypes::RenderMillimeters, 1.0, false, nullptr, nullptr );
|
||||
|
||||
std::unique_ptr< QgsFeatureRenderer > renderer( vl->renderer()->clone() );
|
||||
@ -1048,7 +1053,6 @@ void QgsDxfExport::writeEntities()
|
||||
writeEntitiesSymbolLevels( vl );
|
||||
renderer->stopRender( ctx );
|
||||
|
||||
delete ctx.expressionContext().popScope();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1089,7 +1093,7 @@ void QgsDxfExport::writeEntities()
|
||||
continue;
|
||||
}
|
||||
|
||||
bool isGeometryGenerator = ( sl->layerType() == "GeometryGenerator" );
|
||||
bool isGeometryGenerator = ( sl->layerType() == QLatin1String( "GeometryGenerator" ) );
|
||||
if ( isGeometryGenerator )
|
||||
{
|
||||
addGeometryGeneratorSymbolLayer( sctx, ct, lName, sl, true );
|
||||
@ -1110,7 +1114,7 @@ void QgsDxfExport::writeEntities()
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( s->symbolLayer( 0 )->layerType() == "GeometryGenerator" )
|
||||
if ( s->symbolLayer( 0 )->layerType() == QLatin1String( "GeometryGenerator" ) )
|
||||
{
|
||||
addGeometryGeneratorSymbolLayer( sctx, ct, lName, s->symbolLayer( 0 ), false );
|
||||
}
|
||||
@ -1132,7 +1136,6 @@ void QgsDxfExport::writeEntities()
|
||||
}
|
||||
|
||||
renderer->stopRender( ctx );
|
||||
delete ctx.expressionContext().popScope();
|
||||
}
|
||||
|
||||
engine.run( ctx );
|
||||
@ -3989,7 +3992,7 @@ QgsRenderContext QgsDxfExport::renderContext() const
|
||||
return context;
|
||||
}
|
||||
|
||||
double QgsDxfExport::mapUnitScaleFactor( double scaleDenominator, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits, double mapUnitsPerPixel )
|
||||
double QgsDxfExport::mapUnitScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits, double mapUnitsPerPixel )
|
||||
{
|
||||
if ( symbolUnits == QgsUnitTypes::RenderMapUnits )
|
||||
{
|
||||
@ -3997,7 +4000,7 @@ double QgsDxfExport::mapUnitScaleFactor( double scaleDenominator, QgsUnitTypes::
|
||||
}
|
||||
else if ( symbolUnits == QgsUnitTypes::RenderMillimeters )
|
||||
{
|
||||
return ( scaleDenominator * QgsUnitTypes::fromUnitToUnitFactor( QgsUnitTypes::DistanceMeters, mapUnits ) / 1000.0 );
|
||||
return ( scale * QgsUnitTypes::fromUnitToUnitFactor( QgsUnitTypes::DistanceMeters, mapUnits ) / 1000.0 );
|
||||
}
|
||||
else if ( symbolUnits == QgsUnitTypes::RenderPixels )
|
||||
{
|
||||
|
@ -391,7 +391,7 @@ class CORE_EXPORT QgsDxfExport
|
||||
* \param mapUnits the map units
|
||||
* \param mapUnitsPerPixel Map units per pixel
|
||||
*/
|
||||
static double mapUnitScaleFactor( double scaleDenominator, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits, double mapUnitsPerPixel = 1.0 );
|
||||
static double mapUnitScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits, double mapUnitsPerPixel = 1.0 );
|
||||
|
||||
/**
|
||||
* Clips value to scale minimum/maximum
|
||||
|
@ -24,7 +24,6 @@ QgsDxfPaintEngine::QgsDxfPaintEngine( const QgsDxfPaintDevice *dxfDevice, QgsDxf
|
||||
: QPaintEngine( QPaintEngine::AllFeatures /*QPaintEngine::PainterPaths | QPaintEngine::PaintOutsidePaintEvent*/ )
|
||||
, mPaintDevice( dxfDevice )
|
||||
, mDxf( dxf )
|
||||
, mOpacity( 1.0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ class CORE_EXPORT QgsDxfPaintEngine: public QPaintEngine
|
||||
QPen mPen;
|
||||
QBrush mBrush;
|
||||
//! Opacity
|
||||
double mOpacity;
|
||||
double mOpacity = 1.0;
|
||||
QString mLayer;
|
||||
QPointF mShift;
|
||||
QgsRingSequence mPolygon;
|
||||
|
Loading…
x
Reference in New Issue
Block a user