Skip to content

Commit

Permalink
Fix width/height-less SVGs not rendering well romannurik#223
Browse files Browse the repository at this point in the history
  • Loading branch information
romannurik committed Oct 12, 2020
1 parent d9a60fe commit 23423b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/studio/forms/image-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,11 @@ export class ImageField extends Field {
}
}
let ctx = studio.Drawing.context(size);
// don't specify source width and height because it breaks
// SVGs that don't have a width or height set (i.e. viewbox only)
// and is irrelevant for PNGs
ctx.drawImage(img,
0, 0, origSize.w, origSize.h,
// 0, 0, origSize.w, origSize.h,
0, 0, size.w, size.h);
resolve({ctx, size});
});
Expand Down

0 comments on commit 23423b5

Please sign in to comment.