From 9efafa34b18edfbe366d7b8d3cb90afa252a4713 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Fri, 9 Apr 2021 15:39:58 -0500 Subject: [PATCH] Ensure that monitors will be visible when imported --- src/serialization/sb3.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/serialization/sb3.js b/src/serialization/sb3.js index 34f0333f..22f569a4 100644 --- a/src/serialization/sb3.js +++ b/src/serialization/sb3.js @@ -1093,6 +1093,8 @@ const deserializeMonitor = function (monitorData, runtime, targets, extensions) const yOffset = (runtime.stageHeight - 360) / 2; monitorData.x += xOffset; monitorData.y += yOffset; + monitorData.x = MathUtil.clamp(monitorData.x, 0, runtime.stageWidth); + monitorData.y = MathUtil.clamp(monitorData.y, 0, runtime.stageHeight); // If the serialized monitor has spriteName defined, look up the sprite // by name in the given list of targets and update the monitor's targetId