diff --git a/extensions/SharkPool/Camera.js b/extensions/SharkPool/Camera.js index df0bf6e469..815c2cee55 100644 --- a/extensions/SharkPool/Camera.js +++ b/extensions/SharkPool/Camera.js @@ -4,7 +4,7 @@ // By: SharkPool // License: MIT -// Version V.1.0.09 +// Version V.1.0.1 (function (Scratch) { "use strict"; @@ -274,6 +274,23 @@ } }; + const ogUpdateVisible = render.exports.Drawable.prototype.updateVisible; + render.exports.Drawable.prototype.updateVisible = function (isVisible) { + if (!this[cameraSymbol]) setupState(this); + if (isVisible) { + // save some renderer calls, packing this all into one + // while running only when isVisible is true combines this + // into a single renderer call + this[cameraSymbol].needsRefresh = true; + this.updateProperties({ + position: this._position, + direction: this._direction, + scale: this.scale, + }); + } + ogUpdateVisible.call(this, isVisible); + }; + // Clones should inherit the parents camera const ogInitDrawable = vm.exports.RenderedTarget.prototype.initDrawable; vm.exports.RenderedTarget.prototype.initDrawable = function (layerGroup) {