Skip to content

Commit d9f3ac8

Browse files
committed
Fix reprojected single band color drawing
1 parent 60516a8 commit d9f3ac8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/raster/qgssinglebandcolordatarenderer.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ void QgsSingleBandColorDataRenderer::draw( QPainter* p, QgsRasterViewPort* viewP
8383
}
8484
else
8585
{
86+
QRgb pixelColor;
8687
for ( int j = 0; j < nRasterCols; ++j )
8788
{
8889
QRgb c((( uint* )( rasterData ) )[currentRasterPos] );
89-
scanLine[i] = qRgba( qRed( c ), qGreen( c ), qBlue( c ), 255 );
90+
pixelColor = qRgba( qRed( c ), qGreen( c ), qBlue( c ), 255 );
91+
memcpy( &( scanLine[j*4] ), &pixelColor, 4 );
9092
++currentRasterPos;
9193
}
9294
}

0 commit comments

Comments
 (0)