From 8ce13403bc13e1b0aede614328228a6f64017db7 Mon Sep 17 00:00:00 2001 From: ty0x2333 Date: Wed, 26 Jan 2022 07:12:35 +0800 Subject: [PATCH] Fix the bug that `decodedAndScaledDownImageWithImage` does not render the image completely due to the loss of precision. --- SDWebImage/Core/SDImageCoderHelper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDWebImage/Core/SDImageCoderHelper.m b/SDWebImage/Core/SDImageCoderHelper.m index 321710b5..95a95000 100644 --- a/SDWebImage/Core/SDImageCoderHelper.m +++ b/SDWebImage/Core/SDImageCoderHelper.m @@ -448,7 +448,7 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over float dify = destTile.size.height; destTile.size.height = CGImageGetHeight( sourceTileImageRef ) * imageScale; dify -= destTile.size.height; - destTile.origin.y += dify; + destTile.origin.y = MIN(0, destTile.origin.y + dify); } CGContextDrawImage( destContext, destTile, sourceTileImageRef ); CGImageRelease( sourceTileImageRef );