Skip to content

Commit f5b5efc

Browse files
author
rblazek
committed
alignment better, avoid artifacts
git-svn-id: http://svn.osgeo.org/qgis/trunk@15423 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 51a07a6 commit f5b5efc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/providers/gdal/qgsgdalprovider.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,11 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
670670
int topAddPixels = static_cast<int> ( round( topSpace / yRes ) );
671671

672672
QgsDebugMsg( QString("xAddPixels = %1 yAddPixels = %2 leftAddPixels = %3 topAddPixels = %4").arg(xAddPixels).arg(yAddPixels).arg(leftAddPixels).arg(topAddPixels) );
673+
// Currently only positive allowed, verify if negative has sense and check following use
674+
xAddPixels = xAddPixels > 0 ? xAddPixels : 0;
675+
yAddPixels = yAddPixels > 0 ? yAddPixels : 0;
676+
leftAddPixels = leftAddPixels > 0 ? leftAddPixels : 0;
677+
topAddPixels = topAddPixels > 0 ? topAddPixels : 0;
673678

674679
int totalWidth = width + xAddPixels;
675680
int totalHeight = height + yAddPixels;

0 commit comments

Comments
 (0)