mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
Merge pull request #2449 from apple502j/patch-13
fix: wrapClamp direction during deserialization
This commit is contained in:
commit
2ae67598ee
2 changed files with 6 additions and 2 deletions
|
@ -684,7 +684,9 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip,
|
|||
target.y = object.scratchY;
|
||||
}
|
||||
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')) {
|
||||
target.draggable = object.isDraggable;
|
||||
|
|
|
@ -1060,7 +1060,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