Navigation Menu

Skip to content

Commit

Permalink
How did GIS look like in 1990?
Browse files Browse the repository at this point in the history
Apologies to fellow developers for being silly
  • Loading branch information
wonder-sk committed Sep 26, 2014
1 parent 27abd20 commit 34b33fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -6749,6 +6749,11 @@ void QgisApp::userCenter()
else
mDizzyTimer->start( 100 );
}
else if ( mCoordsEdit->text() == "retro" )
{
mMapCanvas->setProperty( "retro", !mMapCanvas->property( "retro" ).toBool() );
refreshMapCanvas();
}

QStringList parts = mCoordsEdit->text().split( ',' );
if ( parts.size() != 2 )
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgsmapcanvasmap.cpp
Expand Up @@ -35,6 +35,12 @@ QgsMapCanvasMap::~QgsMapCanvasMap()
void QgsMapCanvasMap::setContent( const QImage& image, const QgsRectangle& rect )
{
mImage = image;

// For true retro fans: this is approximately how the graphics looked like in 1990
if ( mMapCanvas->property( "retro" ).toBool() )
mImage = mImage.scaled( mImage.width() / 3, mImage.height() / 3 )
.convertToFormat( QImage::Format_Indexed8, Qt::OrderedDither | Qt::OrderedAlphaDither );

setRect( rect );
}

Expand Down

2 comments on commit 34b33fa

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wonder-sk shouldn't a change this important come with unit tests?

@wonder-sk
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson MC Hammer says it is better not to touch the code again rather than writing unit tests for it:
http://www.youtube.com/watch?v=otCpCn0l4Wo

Please sign in to comment.