Skip to content

Commit 40b9683

Browse files
committed
Formatting fixes
1 parent a91eb1d commit 40b9683

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/SVGMIP.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class SVGMIP {
4545
}
4646
}
4747

48+
dispose () {
49+
this._renderer.gl.deleteTexture(this.getTexture());
50+
}
51+
4852
getTexture () {
4953
if (this.dirty) {
5054
this.draw();

src/SVGSkin.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ const SvgRenderer = require('scratch-svg-renderer').SVGRenderer;
44

55
const MAX_TEXTURE_DIMENSION = 2048;
66
const MIN_TEXTURE_SCALE = 1 / 256;
7+
/**
8+
* All scaled renderings of the SVG are stored in an array. The 1.0 scale of
9+
* the SVG is stored at the 8th index. The smallest possible 1 / 256 scale
10+
* rendering is stored at the 0th index.
11+
* @const {number}
12+
*/
713
const INDEX_OFFSET = 8;
814

915
class SVGSkin extends Skin {
@@ -43,7 +49,7 @@ class SVGSkin extends Skin {
4349
if (this._texture) {
4450
for (const mip of this._scaledMIPs) {
4551
if (mip) {
46-
this._renderer.gl.deleteTexture(mip.getTexture());
52+
mip.dispose();
4753
}
4854
}
4955
this._texture = null;

0 commit comments

Comments
 (0)