Skip to content
Permalink
Browse files

partial fix for label size + label tweaks

  • Loading branch information
etiennesky committed Jun 24, 2012
1 parent 02beea3 commit 52d9f3a3a48d552f50c1b8a052d44daf2172af7c
Showing with 26 additions and 3 deletions.
  1. +15 −3 src/app/qgsdecorationgrid.cpp
  2. +11 −0 src/app/qgsdecorationgriddialog.cpp
@@ -111,9 +111,19 @@ void QgsDecorationGrid::projectRead()
"/AnnotationPosition", 0 );
mGridAnnotationDirection = ( GridAnnotationDirection ) QgsProject::instance()->readNumEntry( mNameConfig,
"/AnnotationDirection", 0 );
mGridAnnotationFont.fromString( QgsProject::instance()->readEntry( mNameConfig, "/AnnotationFont", "" ) );
QString fontStr = QgsProject::instance()->readEntry( mNameConfig, "/AnnotationFont", "" );
if ( fontStr != "" )
{
mGridAnnotationFont.fromString( fontStr );
}
else
{
mGridAnnotationFont = QFont();
// TODO fix font scaling problem - put a slightly large font for now
mGridAnnotationFont.setPointSize( 16 );
}
mAnnotationFrameDistance = QgsProject::instance()->readDoubleEntry( mNameConfig, "/AnnotationFrameDistance", 0 );
mGridAnnotationPrecision = QgsProject::instance()->readNumEntry( mNameConfig, "/AnnotationPrecision", 3 );
mGridAnnotationPrecision = QgsProject::instance()->readNumEntry( mNameConfig, "/AnnotationPrecision", 0 );

// read symbol info from xml
QDomDocument doc;
@@ -715,7 +725,9 @@ double QgsDecorationGrid::fontAscentMillimeters( const QFont& font ) const

double QgsDecorationGrid::pixelFontSize( double pointSize ) const
{
return ( pointSize * 0.3527 );
// return ( pointSize * 0.3527 );
// TODO fix font scaling problem - this seems to help, but text seems still a bit too small (about 5/6)
return pointSize;
}

QFont QgsDecorationGrid::scaledFontPixelSize( const QFont& font ) const
@@ -284,6 +284,10 @@ void QgsDecorationGridDialog::on_mPbtnUpdateFromLayer_clicked()
mIntervalYSpinBox->setValue( values[1] );
mOffsetXSpinBox->setValue( values[2] );
mOffsetYSpinBox->setValue( values[3] );
if ( values[0] >= 1 )
mCoordinatePrecisionSpinBox->setValue( 0 );
else
mCoordinatePrecisionSpinBox->setValue( 3 );
}
}

@@ -313,6 +317,13 @@ void QgsDecorationGridDialog::updateInterval( bool force )
mIntervalYSpinBox->setValue( values[1] );
mOffsetXSpinBox->setValue( values[2] );
mOffsetYSpinBox->setValue( values[3] );
// also update coord. precision
// if interval >= 1, set precision=0 because we have a rounded value
// else set it to previous default of 3
if ( values[0] >= 1 )
mCoordinatePrecisionSpinBox->setValue( 0 );
else
mCoordinatePrecisionSpinBox->setValue( 3 );
}
}
}

0 comments on commit 52d9f3a

Please sign in to comment.
You can’t perform that action at this time.