diff --git a/src/SVGSkin.js b/src/SVGSkin.js index 5f3cf0833..2acdf7bfd 100644 --- a/src/SVGSkin.js +++ b/src/SVGSkin.js @@ -106,12 +106,13 @@ class SVGSkin extends Skin { const {width, height} = this._svgMeasurements; this._canvas.width = width * scale; this._canvas.height = height * scale; - // Even if the canvas at the current scale has a nonzero size, the image's dimensions are floored pre-scaling. - // e.g. if an image has a width of 0.4 and is being rendered at 3x scale, the canvas will have a width of 1, but - // the image's width will be rounded down to 0 on some browsers (Firefox) prior to being drawn at that scale. if ( this._canvas.width <= 0 || this._canvas.height <= 0 || + // Even if the canvas at the current scale has a nonzero size, the image's dimensions are floored + // pre-scaling; e.g. if an image has a width of 0.4 and is being rendered at 3x scale, the canvas will have + // a width of 1, but the image's width will be rounded down to 0 on some browsers (Firefox) prior to being + // drawn at that scale, resulting in an IndexSizeError if we attempt to draw it. this._svgImage.naturalWidth <= 0 || this._svgImage.naturalHeight <= 0 ) return super.getTexture();