Skip to content

Commit

Permalink
Fix for bug #3143, apply double values for label sizes
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14446 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 29, 2010
1 parent 4d7c419 commit 849407e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/qgslabelinggui.cpp
Expand Up @@ -406,7 +406,7 @@ void QgsLabelingGui::updateFont( QFont font )
{
fontSizeUnitString = tr( "map units" );
}
lblFontName->setText( QString( "%1, %2 %3" ).arg( font.family() ).arg( font.pointSize() ).arg( fontSizeUnitString ) );
lblFontName->setText( QString( "%1, %2 %3" ).arg( font.family() ).arg( font.pointSizeF() ).arg( fontSizeUnitString ) );
lblFontPreview->setFont( font );
updatePreview();
}
Expand Down
5 changes: 3 additions & 2 deletions src/core/qgspallabeling.cpp
Expand Up @@ -263,10 +263,11 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
placement = ( Placement ) layer->customProperty( "labeling/placement" ).toInt();
placementFlags = layer->customProperty( "labeling/placementFlags" ).toUInt();
QString fontFamily = layer->customProperty( "labeling/fontFamily" ).toString();
int fontSize = layer->customProperty( "labeling/fontSize" ).toInt();
double fontSize = layer->customProperty( "labeling/fontSize" ).toDouble();
int fontWeight = layer->customProperty( "labeling/fontWeight" ).toInt();
bool fontItalic = layer->customProperty( "labeling/fontItalic" ).toBool();
textFont = QFont( fontFamily, fontSize, fontWeight, fontItalic );
textFont.setPointSizeF( fontSize ); //double precision needed because of map units
textColor = _readColor( layer, "labeling/textColor" );
enabled = layer->customProperty( "labeling/enabled" ).toBool();
priority = layer->customProperty( "labeling/priority" ).toInt();
Expand Down Expand Up @@ -295,7 +296,7 @@ void QgsPalLayerSettings::writeToLayer( QgsVectorLayer* layer )
layer->setCustomProperty( "labeling/placementFlags", ( unsigned int )placementFlags );

layer->setCustomProperty( "labeling/fontFamily", textFont.family() );
layer->setCustomProperty( "labeling/fontSize", textFont.pointSize() );
layer->setCustomProperty( "labeling/fontSize", textFont.pointSizeF() );
layer->setCustomProperty( "labeling/fontWeight", textFont.weight() );
layer->setCustomProperty( "labeling/fontItalic", textFont.italic() );

Expand Down
7 changes: 5 additions & 2 deletions src/ui/qgslabelingguibase.ui
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>504</width>
<height>686</height>
<width>515</width>
<height>692</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -568,6 +568,9 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDoubleSpinBox" name="mFontSizeSpinBox">
<property name="decimals">
<number>4</number>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
Expand Down

0 comments on commit 849407e

Please sign in to comment.