diff --git a/src/SVGSkin.js b/src/SVGSkin.js index 3ef4cd6..4d68ca0 100644 --- a/src/SVGSkin.js +++ b/src/SVGSkin.js @@ -34,10 +34,10 @@ class SVGSkin extends Skin { } /** - * @return {[number,number]} the "native" size, in texels, of this skin. + * @return {[number,number]} the natural size, in Scratch units, of this skin. */ get size () { - return [this._svgRenderer.canvas.width, this._svgRenderer.canvas.height]; + return this._svgRenderer.size; } /** diff --git a/src/svg-quirks-mode/svg-renderer.js b/src/svg-quirks-mode/svg-renderer.js index 9198af8..8965573 100644 --- a/src/svg-quirks-mode/svg-renderer.js +++ b/src/svg-quirks-mode/svg-renderer.js @@ -72,6 +72,13 @@ class SvgRenderer { this._draw(); } + /** + * @return {[number,number]} the natural size, in Scratch units, of this SVG. + */ + get size () { + return [this._measurements.width, this._measurements.height]; + } + /** * Transforms an SVG's text elements for Scratch 2.0 quirks. * These quirks include: