Fix the bug that `decodedAndScaledDownImageWithImage` does not render the image completely due to the loss of precision.

This commit is contained in:
ty0x2333 2022-01-26 07:12:35 +08:00
parent 0cd9a6485a
commit 8ce13403bc
1 changed files with 1 additions and 1 deletions

View File

@ -448,7 +448,7 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over
float dify = destTile.size.height; float dify = destTile.size.height;
destTile.size.height = CGImageGetHeight( sourceTileImageRef ) * imageScale; destTile.size.height = CGImageGetHeight( sourceTileImageRef ) * imageScale;
dify -= destTile.size.height; dify -= destTile.size.height;
destTile.origin.y += dify; destTile.origin.y = MIN(0, destTile.origin.y + dify);
} }
CGContextDrawImage( destContext, destTile, sourceTileImageRef ); CGContextDrawImage( destContext, destTile, sourceTileImageRef );
CGImageRelease( sourceTileImageRef ); CGImageRelease( sourceTileImageRef );