Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for raster printing, #3622
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15528 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 17, 2011
1 parent 4f08ba7 commit 19c6201
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -4584,7 +4584,7 @@ bool QgsRasterImageBuffer::createNextPartImage()
if ( mMapToPixel )
{
imageX = mViewPort->topLeftPoint.x();
imageY = mViewPort->topLeftPoint.y() + mCurrentPartRasterMin / mMapToPixel->mapUnitsPerPixel();
imageY = mViewPort->topLeftPoint.y() + mCurrentPartRasterMin;
}

QgsDebugMsg( QString( "mCurrentPartRasterMin = %1" ).arg( mCurrentPartRasterMin ) );
Expand Down Expand Up @@ -4654,18 +4654,18 @@ bool QgsRasterImageBuffer::createNextPartImage()
{
return false;
}
mNumCurrentImageRows = ySize;
QgsDebugMsg( "alloc " + QString::number( size * xSize * ySize ) );
mCurrentGDALData = VSIMalloc( size * xSize * ySize );
mNumCurrentImageRows = rasterYSize;
QgsDebugMsg( "alloc " + QString::number( size * xSize * rasterYSize ) );
mCurrentGDALData = VSIMalloc( size * xSize * rasterYSize );

double yMax = mViewPort->mDrawnExtent.yMaximum() - mCurrentRow * mMapToPixel->mapUnitsPerPixel();
double yMin = yMax - ySize * mMapToPixel->mapUnitsPerPixel();
double yMin = yMax - rasterYSize * mMapToPixel->mapUnitsPerPixel();

QgsDebugMsg( QString( "mCurrentRow = %1 yMaximum = %2 ySize = %3 mapUnitsPerPixel = %4" ).arg( mCurrentRow ).arg( mViewPort->mDrawnExtent.yMaximum() ).arg( ySize ).arg( mMapToPixel->mapUnitsPerPixel() ) );
QgsRectangle myPartExtent( mViewPort->mDrawnExtent.xMinimum(), yMin,
mViewPort->mDrawnExtent.xMaximum(), yMax );
QgsDebugMsg( "myPartExtent is " + myPartExtent.toString() );
mDataProvider->readBlock( mBandNo, myPartExtent, xSize, ySize, mViewPort->mSrcCRS, mViewPort->mDestCRS, mCurrentGDALData );
mDataProvider->readBlock( mBandNo, myPartExtent, xSize, rasterYSize , mViewPort->mSrcCRS, mViewPort->mDestCRS, mCurrentGDALData );

//create the QImage
if ( mWritingEnabled )
Expand Down

0 comments on commit 19c6201

Please sign in to comment.