mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
wrapClamp direction during sb3 deserialization
This commit is contained in:
parent
1012a2aa61
commit
bfbea4266a
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue