Skip to content

Commit 19c6201

Browse files
author
mhugent
committed
Fix for raster printing, #3622
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15528 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4f08ba7 commit 19c6201

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/raster/qgsrasterlayer.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -4584,7 +4584,7 @@ bool QgsRasterImageBuffer::createNextPartImage()
45844584
if ( mMapToPixel )
45854585
{
45864586
imageX = mViewPort->topLeftPoint.x();
4587-
imageY = mViewPort->topLeftPoint.y() + mCurrentPartRasterMin / mMapToPixel->mapUnitsPerPixel();
4587+
imageY = mViewPort->topLeftPoint.y() + mCurrentPartRasterMin;
45884588
}
45894589

45904590
QgsDebugMsg( QString( "mCurrentPartRasterMin = %1" ).arg( mCurrentPartRasterMin ) );
@@ -4654,18 +4654,18 @@ bool QgsRasterImageBuffer::createNextPartImage()
46544654
{
46554655
return false;
46564656
}
4657-
mNumCurrentImageRows = ySize;
4658-
QgsDebugMsg( "alloc " + QString::number( size * xSize * ySize ) );
4659-
mCurrentGDALData = VSIMalloc( size * xSize * ySize );
4657+
mNumCurrentImageRows = rasterYSize;
4658+
QgsDebugMsg( "alloc " + QString::number( size * xSize * rasterYSize ) );
4659+
mCurrentGDALData = VSIMalloc( size * xSize * rasterYSize );
46604660

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

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

46704670
//create the QImage
46714671
if ( mWritingEnabled )

0 commit comments

Comments
 (0)