mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
wrapClamp direction during sb/sb2 deserialization
This commit is contained in:
parent
58c460b16d
commit
1012a2aa61
1 changed files with 3 additions and 1 deletions
|
@ -684,7 +684,9 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip,
|
||||||
target.y = object.scratchY;
|
target.y = object.scratchY;
|
||||||
}
|
}
|
||||||
if (object.hasOwnProperty('direction')) {
|
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('isDraggable')) {
|
if (object.hasOwnProperty('isDraggable')) {
|
||||||
target.draggable = object.isDraggable;
|
target.draggable = object.isDraggable;
|
||||||
|
|
Loading…
Reference in a new issue