Skip to content

Commit e62a45a

Browse files
authored
SharkPool/Camera: Fix critical regression from previous commit (#2376)
1 parent 9293937 commit e62a45a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

extensions/SharkPool/Camera.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// By: SharkPool
55
// License: MIT
66

7-
// Version V.1.0.1
7+
// Version V.1.0.11
88

99
(function (Scratch) {
1010
"use strict";
@@ -278,14 +278,17 @@
278278
render.exports.Drawable.prototype.updateVisible = function (isVisible) {
279279
if (!this[cameraSymbol]) setupState(this);
280280
if (isVisible && this._visible !== isVisible) {
281+
const camSystem = this[cameraSymbol];
282+
const safeOgSZ = camSystem.ogSZ !== 0 ? camSystem.ogSZ : 1e-10;
283+
const updatedScale = [this.scale[0] / safeOgSZ, this.scale[1] / safeOgSZ];
284+
281285
// save some renderer calls, packing this all into one
282286
// while running only when isVisible is true combines this
283287
// into a single renderer call
284-
this[cameraSymbol].needsRefresh = true;
285288
this.updateProperties({
286-
position: this._position,
287-
direction: this._direction,
288-
scale: this.scale,
289+
position: translatePosition(this._position, true, camSystem),
290+
direction: this._direction + camSystem.ogDir,
291+
scale: updatedScale,
289292
});
290293
}
291294
ogUpdateVisible.call(this, isVisible);

0 commit comments

Comments
 (0)