From a094eb0c8e2a136351f8bc2daf9166c9b227fde0 Mon Sep 17 00:00:00 2001 From: SharkPool <139097378+SharkPool-SP@users.noreply.github.com> Date: Sun, 14 Dec 2025 01:32:20 -0800 Subject: [PATCH 1/2] Refactor updateVisible method and update version --- extensions/SharkPool/Camera.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/extensions/SharkPool/Camera.js b/extensions/SharkPool/Camera.js index df0bf6e469..3325c93180 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) { From 0c869f19a8aa9d2a3d0c84ef4f33aa79848aa0d9 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Sun, 14 Dec 2025 09:34:16 +0000 Subject: [PATCH 2/2] [Automated] Format code --- extensions/SharkPool/Camera.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/SharkPool/Camera.js b/extensions/SharkPool/Camera.js index 3325c93180..815c2cee55 100644 --- a/extensions/SharkPool/Camera.js +++ b/extensions/SharkPool/Camera.js @@ -285,7 +285,7 @@ this.updateProperties({ position: this._position, direction: this._direction, - scale: this.scale + scale: this.scale, }); } ogUpdateVisible.call(this, isVisible);