File tree Expand file tree Collapse file tree
SDWebImageSVGCoder/Classes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,14 +214,16 @@ - (UIImage *)createBitmapSVGWithData:(nonnull NSData *)data targetSize:(CGSize)t
214214 if (targetSize.width <= 0 ) {
215215 yScale = yRatio;
216216 xScale = yRatio;
217- targetSize.width = size.width * yRatio ;
217+ targetSize.width = size.width * xScale ;
218218 } else if (targetSize.height <= 0 ) {
219219 xScale = xRatio;
220220 yScale = xRatio;
221- targetSize.height = size.height * xRatio ;
221+ targetSize.height = size.height * yScale ;
222222 } else {
223223 xScale = MIN (xRatio, yRatio);
224224 yScale = MIN (xRatio, yRatio);
225+ targetSize.width = size.width * xScale;
226+ targetSize.height = size.height * yScale;
225227 }
226228 } else {
227229 // If we specify only one length of the size but don't keep the ratio, use original size
You can’t perform that action at this time.
0 commit comments