Skip to content

Commit cd33ccf

Browse files
committedJul 20, 2016
Revert "Fix label word and letter spacing cannot be decimals"
This reverts commit 48f090c. Causes issues with font sizes/spacing
1 parent 92eec0e commit cd33ccf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

‎python/core/qgspallabeling.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ class QgsPalLayerSettings
639639
* @param mapUnitScale a mapUnitScale clamper
640640
* @return font pixel size
641641
*/
642-
double sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
642+
int sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
643643

644644
/** Calculates size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
645645
* @param size size to convert

‎src/core/qgspallabeling.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, QgsRenderContext &cont
22232223
return;
22242224
}
22252225

2226-
int fontPixelSize = qRound( sizeToPixel( fontSize, context, fontunits, true, fontSizeMapUnitScale ) );
2226+
int fontPixelSize = sizeToPixel( fontSize, context, fontunits, true, fontSizeMapUnitScale );
22272227
// don't try to show font sizes less than 1 pixel (Qt complains)
22282228
if ( fontPixelSize < 1 )
22292229
{
@@ -3874,9 +3874,9 @@ void QgsPalLayerSettings::parseDropShadow( QgsRenderContext &context )
38743874
dataDefinedValEval( DDBlendMode, QgsPalLayerSettings::ShadowBlendMode, exprVal, context.expressionContext() );
38753875
}
38763876

3877-
double QgsPalLayerSettings::sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor, const QgsMapUnitScale& mapUnitScale ) const
3877+
int QgsPalLayerSettings::sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor, const QgsMapUnitScale& mapUnitScale ) const
38783878
{
3879-
return scaleToPixelContext( size, c, unit, rasterfactor, mapUnitScale ) + 0.5;
3879+
return static_cast< int >( scaleToPixelContext( size, c, unit, rasterfactor, mapUnitScale ) + 0.5 );
38803880
}
38813881

38823882
double QgsPalLayerSettings::scaleToPixelContext( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor, const QgsMapUnitScale& mapUnitScale ) const

‎src/core/qgspallabeling.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ class CORE_EXPORT QgsPalLayerSettings
625625
* @param mapUnitScale a mapUnitScale clamper
626626
* @return font pixel size
627627
*/
628-
double sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
628+
int sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
629629

630630
/** Calculates size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
631631
* @param size size to convert

0 commit comments

Comments
 (0)
Please sign in to comment.