Fix SVG size calculation
It was being incorrectly calculated based on devicePixelRatio. Fixes LLK/scratch-gui#73. Thanks to @cwillisf for figuring it out!
This commit is contained in:
parent
c3c7bb28ae
commit
9a8f4f2a88
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user