Compare commits

..

1 Commits

Author SHA1 Message Date
greenkeeper[bot]
533e71d4a1 chore(package): update scratch-vm to version 0.2.0-prerelease.20200402182733
Closes #560
2020-04-02 23:41:45 +00:00
2 changed files with 3 additions and 18 deletions

View File

@@ -37,7 +37,7 @@
"gh-pages": "^1.0.0",
"jsdoc": "^3.5.5",
"json": "^9.0.4",
"scratch-vm": "0.2.0-prerelease.20191227164934",
"scratch-vm": "0.2.0-prerelease.20200402182733",
"tap": "^11.0.0",
"travis-after-all": "^1.4.4",
"uglifyjs-webpack-plugin": "^1.2.5",

View File

@@ -220,20 +220,9 @@ class RenderWebGL extends EventEmitter {
* @param {int} pixelsTall The desired height in device-independent pixels.
*/
resize (pixelsWide, pixelsTall) {
const {canvas} = this._gl;
const pixelRatio = window.devicePixelRatio || 1;
const newWidth = pixelsWide * pixelRatio;
const newHeight = pixelsTall * pixelRatio;
// Certain operations, such as moving the color picker, call `resize` once per frame, even though the canvas
// size doesn't change. To avoid unnecessary canvas updates, check that we *really* need to resize the canvas.
if (canvas.width !== newWidth || canvas.height !== newHeight) {
canvas.width = newWidth;
canvas.height = newHeight;
// Resizing the canvas causes it to be cleared, so redraw it.
this.draw();
}
this._gl.canvas.width = pixelsWide * pixelRatio;
this._gl.canvas.height = pixelsTall * pixelRatio;
}
/**
@@ -1773,10 +1762,6 @@ class RenderWebGL extends EventEmitter {
*/
_getConvexHullPointsForDrawable (drawableID) {
const drawable = this._allDrawables[drawableID];
drawable.updateMatrix();
drawable.skin.updateSilhouette(this._getDrawableScreenSpaceScale(drawable));
const [width, height] = drawable.skin.size;
// No points in the hull if invisible or size is 0.
if (!drawable.getVisible() || width === 0 || height === 0) {