@@ -1118,7 +1118,7 @@ QgsRasterLayer::RasterPyramidList QgsRasterLayer::buildPyramidList()
1118
1118
int myWidth = mWidth ;
1119
1119
int myHeight = mHeight ;
1120
1120
int myDivisor = 2 ;
1121
-
1121
+
1122
1122
if ( mDataProvider ) return mPyramidList ;
1123
1123
1124
1124
GDALRasterBandH myGDALBand = GDALGetRasterBand ( mGdalDataset , 1 ); // just use the first band
@@ -3227,7 +3227,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
3227
3227
mDrawingStyle = MultiBandColor; // sensible default
3228
3228
3229
3229
// Setup source CRS
3230
- if ( mProviderKey == " wms" )
3230
+ if ( mProviderKey == " wms" )
3231
3231
{
3232
3232
*mCRS = QgsCoordinateReferenceSystem ();
3233
3233
mCRS ->createFromOgcWmsCrs ( crs );
@@ -5417,7 +5417,8 @@ bool QgsRasterLayer::update()
5417
5417
5418
5418
if ( mLastModified < QgsRasterLayer::lastModified ( source () ) )
5419
5419
{
5420
- if ( !usesProvider () ) {
5420
+ if ( !usesProvider () )
5421
+ {
5421
5422
QgsDebugMsg ( " Outdated -> reload" );
5422
5423
closeDataset ();
5423
5424
return readFile ( source () );
@@ -5600,9 +5601,25 @@ bool QgsRasterImageBuffer::createNextPartImage()
5600
5601
}
5601
5602
else
5602
5603
{
5603
- double xLeft = mViewPort ->topLeftPoint .x ();
5604
- double yTop = mViewPort ->topLeftPoint .y () + fabs ( mGeoTransform [5 ] ) * mCurrentPartRasterMin / mMapToPixel ->mapUnitsPerPixel ();
5605
- mPainter ->drawImage ( QPointF ( xLeft, yTop + 0.5 ), *mCurrentImage );
5604
+ int paintXoffset = static_cast <int >(
5605
+ ( mViewPort ->rectXOffsetFloat -
5606
+ mViewPort ->rectXOffset )
5607
+ / mMapToPixel ->mapUnitsPerPixel ()
5608
+ * fabs ( mGeoTransform [1 ] )
5609
+ );
5610
+
5611
+ int paintYoffset = static_cast <int >(
5612
+ ( mViewPort ->rectYOffsetFloat -
5613
+ mViewPort ->rectYOffset )
5614
+ / mMapToPixel ->mapUnitsPerPixel ()
5615
+ * fabs ( mGeoTransform [5 ] )
5616
+ );
5617
+
5618
+ mPainter ->drawImage ( static_cast <int >( mViewPort ->topLeftPoint .x () + 0.5 ),
5619
+ static_cast <int >( mViewPort ->topLeftPoint .y () + 0.5 + fabs ( mGeoTransform [5 ] ) * mCurrentPartRasterMin / mMapToPixel ->mapUnitsPerPixel () ),
5620
+ *mCurrentImage ,
5621
+ paintXoffset,
5622
+ paintYoffset );
5606
5623
}
5607
5624
}
5608
5625
}
0 commit comments