Skip to content

Commit

Permalink
-Added check to qgsrect intersect to see if rects actually intersect
Browse files Browse the repository at this point in the history
-Patch for custom dialog box, closes ticket #1232

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9267 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts committed Sep 5, 2008
1 parent 4d78496 commit c87105d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/qgscustomprojectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ void QgsCustomProjectionDialog::on_pbnSave_clicked()

sqlite3_finalize( myPreparedStatement );
sqlite3_close( myDatabase );
pbnDelete->setEnabled( true );
}

void QgsCustomProjectionDialog::on_pbnCalculate_clicked()
Expand Down
7 changes: 6 additions & 1 deletion src/core/qgsrect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ void QgsRect::expand( double scaleFactor, const QgsPoint * cp )
QgsRect QgsRect::intersect( QgsRect * rect ) const
{
QgsRect intersection = QgsRect();

//If they don't actually intersect an empty QgsRect should be returned
if ( !rect || !intersects( *rect ) )
{
return intersection;
}

intersection.setXMinimum( xmin > rect->xMin() ? xmin : rect->xMin() );
intersection.setXMaximum( xmax < rect->xMax() ? xmax : rect->xMax() );
intersection.setYMinimum( ymin > rect->yMin() ? ymin : rect->yMin() );
Expand Down

0 comments on commit c87105d

Please sign in to comment.