wrapClamp direction during sb3 deserialization
This commit is contained in:
1 parent
1012a2aa61
commit
bfbea4266a
1 file changed
+3
-1
@@ -1043,7 +1043,9 @@ const parseScratchObject = function (object, runtime, extensions, zip, assets) {
|
||||
target.y = object.y;
|
||||
}
|
||||
if (object.hasOwnProperty('direction')) {
|
||||
target.direction = object.direction;
|
||||
// Sometimes the direction can be outside of the range: LLK/scratch-gui#5806
|
||||
// wrapClamp it (like we do on RenderedTarget.setDirection)
|
||||
target.direction = MathUtil.wrapClamp(object.direction, -179, 180);
|
||||
}
|
||||
if (object.hasOwnProperty('size')) {
|
||||
target.size = object.size;
|
||||
|
||||
Reference in new issue
Block a user