File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
SDWebImageSVGCoder/Classes Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -214,14 +214,16 @@ - (UIImage *)createBitmapSVGWithData:(nonnull NSData *)data targetSize:(CGSize)t
214
214
if (targetSize.width <= 0 ) {
215
215
yScale = yRatio;
216
216
xScale = yRatio;
217
- targetSize.width = size.width * yRatio ;
217
+ targetSize.width = size.width * xScale ;
218
218
} else if (targetSize.height <= 0 ) {
219
219
xScale = xRatio;
220
220
yScale = xRatio;
221
- targetSize.height = size.height * xRatio ;
221
+ targetSize.height = size.height * yScale ;
222
222
} else {
223
223
xScale = MIN (xRatio, yRatio);
224
224
yScale = MIN (xRatio, yRatio);
225
+ targetSize.width = size.width * xScale;
226
+ targetSize.height = size.height * yScale;
225
227
}
226
228
} else {
227
229
// 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