mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix label word and letter spacing cannot be decimals
This commit is contained in:
parent
5384e203fb
commit
48f090ca79
@ -639,7 +639,7 @@ class QgsPalLayerSettings
|
||||
* @param mapUnitScale a mapUnitScale clamper
|
||||
* @return font pixel size
|
||||
*/
|
||||
int sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
|
||||
double sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
|
||||
|
||||
/** Calculates size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
|
||||
* @param size size to convert
|
||||
|
@ -2223,7 +2223,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, QgsRenderContext &cont
|
||||
return;
|
||||
}
|
||||
|
||||
int fontPixelSize = sizeToPixel( fontSize, context, fontunits, true, fontSizeMapUnitScale );
|
||||
int fontPixelSize = qRound( sizeToPixel( fontSize, context, fontunits, true, fontSizeMapUnitScale ) );
|
||||
// don't try to show font sizes less than 1 pixel (Qt complains)
|
||||
if ( fontPixelSize < 1 )
|
||||
{
|
||||
@ -3874,9 +3874,9 @@ void QgsPalLayerSettings::parseDropShadow( QgsRenderContext &context )
|
||||
dataDefinedValEval( DDBlendMode, QgsPalLayerSettings::ShadowBlendMode, exprVal, context.expressionContext() );
|
||||
}
|
||||
|
||||
int QgsPalLayerSettings::sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor, const QgsMapUnitScale& mapUnitScale ) const
|
||||
double QgsPalLayerSettings::sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor, const QgsMapUnitScale& mapUnitScale ) const
|
||||
{
|
||||
return static_cast< int >( scaleToPixelContext( size, c, unit, rasterfactor, mapUnitScale ) + 0.5 );
|
||||
return scaleToPixelContext( size, c, unit, rasterfactor, mapUnitScale ) + 0.5;
|
||||
}
|
||||
|
||||
double QgsPalLayerSettings::scaleToPixelContext( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor, const QgsMapUnitScale& mapUnitScale ) const
|
||||
|
@ -625,7 +625,7 @@ class CORE_EXPORT QgsPalLayerSettings
|
||||
* @param mapUnitScale a mapUnitScale clamper
|
||||
* @return font pixel size
|
||||
*/
|
||||
int sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
|
||||
double sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
|
||||
|
||||
/** Calculates size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
|
||||
* @param size size to convert
|
||||
|
Loading…
x
Reference in New Issue
Block a user