[QGIS Commit] r15528 - trunk/qgis/src/core/raster
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Thu Mar 17 08:54:28 EDT 2011
Author: mhugent
Date: 2011-03-17 05:54:28 -0700 (Thu, 17 Mar 2011)
New Revision: 15528
Modified:
trunk/qgis/src/core/raster/qgsrasterlayer.cpp
Log:
Fix for raster printing, #3622
Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2011-03-17 11:46:25 UTC (rev 15527)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2011-03-17 12:54:28 UTC (rev 15528)
@@ -4584,7 +4584,7 @@
if ( mMapToPixel )
{
imageX = mViewPort->topLeftPoint.x();
- imageY = mViewPort->topLeftPoint.y() + mCurrentPartRasterMin / mMapToPixel->mapUnitsPerPixel();
+ imageY = mViewPort->topLeftPoint.y() + mCurrentPartRasterMin;
}
QgsDebugMsg( QString( "mCurrentPartRasterMin = %1" ).arg( mCurrentPartRasterMin ) );
@@ -4654,18 +4654,18 @@
{
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 )
More information about the QGIS-commit
mailing list