4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ qgis (1.9.0) UNRELEASED; urgency=low
* symbology-ng-style now in sqlite3
* include cpt-city files
* support DEB_BUILD_OPTIONS' parallel=n
* add python-unittest2 build dependency for lucid, maverick and squeeze
* add python-unittest2 build dependency for maverick and squeeze
* add python-qscintilla2 dependency to python-qgis

-- Jürgen E. Fischer <jef@norbit.de> Sat, 15 Sep 2012 22:51:38 +0200
-- Jürgen E. Fischer <jef@norbit.de> Mon, 17 Sep 2012 18:08:47 +0200

qgis (1.8.0) UNRELEASED; urgency=low

Expand Down
1 change: 0 additions & 1 deletion debian/control.lucid
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Build-Depends:
python-qt4-dev (>=4.1.0),
python-sip (>= 4.5.0),
python-sip-dev (>= 4.5.0),
python-unittest2,
git-core,
doxygen,
graphviz,
Expand Down
8 changes: 8 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5671,6 +5671,10 @@ void QgisApp::options()
{
mScaleEdit->updateScales();
}

qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureDist )->updateSettings();
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureArea )->updateSettings();
qobject_cast<QgsMapToolMeasureAngle*>( mMapTools.mMeasureAngle )->updateSettings();
}

delete optionsDialog;
Expand Down Expand Up @@ -6824,6 +6828,10 @@ void QgisApp::projectProperties()
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
mMapCanvas->setCanvasColor( myColor ); // this is fill color before rendering onto canvas

qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureDist )->updateSettings();
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureArea )->updateSettings();
qobject_cast<QgsMapToolMeasureAngle*>( mMapTools.mMeasureAngle )->updateSettings();

// Set the window title.
setTitleBarText_( *this );

Expand Down
16 changes: 0 additions & 16 deletions src/app/qgsdisplayangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,20 @@ QgsDisplayAngle::QgsDisplayAngle( QgsMapToolMeasureAngle * tool, Qt::WFlags f )
: QDialog( tool->canvas()->topLevelWidget(), f ), mTool( tool )
{
setupUi( this );
QSettings settings;

// Update whenever the canvas has refreshed. Maybe more often than needed,
// but at least every time any canvas related settings changes
connect( mTool->canvas(), SIGNAL( mapCanvasRefreshed() ),
this, SLOT( updateSettings() ) );

updateSettings();
}

QgsDisplayAngle::~QgsDisplayAngle()
{

}


void QgsDisplayAngle::setValueInRadians( double value )
{
mValue = value;
updateUi();
}

void QgsDisplayAngle::updateSettings()
{
emit changeProjectionEnabledState();
}

void QgsDisplayAngle::updateUi()
{

QSettings settings;
QString unitString = settings.value( "/qgis/measure/angleunits", "degrees" ).toString();
int decimals = settings.value( "/qgis/measure/decimalplaces", "3" ).toInt();
Expand Down
8 changes: 0 additions & 8 deletions src/app/qgsdisplayangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ class QgsDisplayAngle: public QDialog, private Ui::QgsDisplayAngleBase
be converted to degrees / gon automatically if necessary*/
void setValueInRadians( double value );

signals:
void changeProjectionEnabledState();

private slots:

//! When any external settings change
void updateSettings();

private:
//! pointer to tool which owns this dialog
QgsMapToolMeasureAngle * mTool;
Expand Down
13 changes: 6 additions & 7 deletions src/app/qgsmaptoolmeasureangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mRubberBand( 0 ), mResultDisplay( 0 )
{
mSnapper.setMapCanvas( canvas );

connect( canvas->mapRenderer(), SIGNAL( destinationSrsChanged() ),
this, SLOT( updateSettings() ) );
}

QgsMapToolMeasureAngle::~QgsMapToolMeasureAngle()
Expand Down Expand Up @@ -87,8 +90,6 @@ void QgsMapToolMeasureAngle::canvasReleaseEvent( QMouseEvent * e )
{
mResultDisplay = new QgsDisplayAngle( this );
QObject::connect( mResultDisplay, SIGNAL( rejected() ), this, SLOT( stopMeasuring() ) );
QObject::connect( mResultDisplay, SIGNAL( changeProjectionEnabledState() ),
this, SLOT( changeProjectionEnabledState() ) );
}
configureDistanceArea();
createRubberBand();
Expand Down Expand Up @@ -147,10 +148,11 @@ QgsPoint QgsMapToolMeasureAngle::snapPoint( const QPoint& p )
}
}

void QgsMapToolMeasureAngle::changeProjectionEnabledState()
void QgsMapToolMeasureAngle::updateSettings()
{
if ( mAnglePoints.size() != 3 )
return;

if ( !mResultDisplay )
return;

Expand All @@ -173,8 +175,8 @@ void QgsMapToolMeasureAngle::changeProjectionEnabledState()
resultAngle = -M_PI + ( resultAngle - M_PI );
}
}
mResultDisplay->setValueInRadians( resultAngle );

mResultDisplay->setValueInRadians( resultAngle );
}

void QgsMapToolMeasureAngle::configureDistanceArea()
Expand All @@ -193,6 +195,3 @@ void QgsMapToolMeasureAngle::configureDistanceArea()
mDa.setEllipsoidalMode( false );
}
}



9 changes: 5 additions & 4 deletions src/app/qgsmaptoolmeasureangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ class QgsMapToolMeasureAngle: public QgsMapTool
/** tool for measuring */
QgsDistanceArea mDa;

public slots:
/** recalculate angle if projection state changed*/
void updateSettings();

private slots:
/**Deletes the rubber band and the dialog*/
void stopMeasuring();

/** recalculate angle if projection state changed*/
void changeProjectionEnabledState();

//! Configures distance area objects with ellipsoid / output crs
/** Configures distance area objects with ellipsoid / output crs*/
void configureDistanceArea();

};
Expand Down
8 changes: 0 additions & 8 deletions src/app/qgsmeasuredialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,11 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WFlags f )
item->setTextAlignment( 0, Qt::AlignRight );
mTable->addTopLevelItem( item );

// Update whenever the canvas has refreshed. Maybe more often than needed,
// but at least every time any canvas related settings changes
connect( mTool->canvas(), SIGNAL( mapCanvasRefreshed() ),
this, SLOT( updateSettings() ) );

updateSettings();
}

void QgsMeasureDialog::updateSettings()
{
if ( !isVisible() )
return;

QSettings settings;

mDecimalPlaces = settings.value( "/qgis/measure/decimalplaces", "3" ).toInt();
Expand Down
5 changes: 4 additions & 1 deletion src/app/qgsmeasuretool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ QgsMeasureTool::QgsMeasureTool( QgsMapCanvas* canvas, bool measureArea )

mDialog = new QgsMeasureDialog( this );
mSnapper.setMapCanvas( canvas );

connect( canvas->mapRenderer(), SIGNAL( destinationSrsChanged() ),
this, SLOT( updateSettings() ) );
}

QgsMeasureTool::~QgsMeasureTool()
Expand Down Expand Up @@ -120,7 +123,7 @@ void QgsMeasureTool::updateSettings()
int myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
int myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );

mDialog->updateSettings();
}

//////////////////////////
Expand Down
12 changes: 11 additions & 1 deletion src/core/symbology-ng/qgssvgcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,17 @@ void QgsSvgCache::cacheImage( QgsSvgCacheEntry* entry )

QPainter p( image );
QSvgRenderer r( entry->svgContent );
r.render( &p );
if ( r.viewBox().width() == r.viewBox().height() )
{
r.render( &p );
}
else
{
QSize s( r.viewBox().size() );
s.scale( imageSize, imageSize, Qt::KeepAspectRatio );
QRect rect(( imageSize - s.width() ) / 2, ( imageSize - s.height() ) / 2, s.width(), s.height() );
r.render( &p, rect );
}

entry->image = image;
mTotalSize += ( image->width() * image->height() * 32 );
Expand Down