From 849407e4a3aa1f2d40e918422930501a84fe8b2f Mon Sep 17 00:00:00 2001 From: mhugent Date: Fri, 29 Oct 2010 12:38:34 +0000 Subject: [PATCH] Fix for bug #3143, apply double values for label sizes git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14446 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/app/qgslabelinggui.cpp | 2 +- src/core/qgspallabeling.cpp | 5 +++-- src/ui/qgslabelingguibase.ui | 7 +++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/qgslabelinggui.cpp b/src/app/qgslabelinggui.cpp index 6bdb6e45982f..c4534df5eeb1 100644 --- a/src/app/qgslabelinggui.cpp +++ b/src/app/qgslabelinggui.cpp @@ -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(); } diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 438cecdadd4b..3e115c7a2269 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -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(); @@ -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() ); diff --git a/src/ui/qgslabelingguibase.ui b/src/ui/qgslabelingguibase.ui index 6679174dc9a1..1c892e82fa22 100644 --- a/src/ui/qgslabelingguibase.ui +++ b/src/ui/qgslabelingguibase.ui @@ -6,8 +6,8 @@ 0 0 - 504 - 686 + 515 + 692 @@ -568,6 +568,9 @@ + + 4 + 999999999.000000000000000