mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Fix setting Infinity to direction (#612)
* Create rendered-target.js * Update math-util.js * Update rendered-target.js * Update math-util.js * Update rendered-target.js
This commit is contained in:
parent
f2bd32a81a
commit
936ff04b0f
1 changed files with 3 additions and 0 deletions
|
@ -231,6 +231,9 @@ class RenderedTarget extends Target {
|
||||||
if (this.isStage) {
|
if (this.isStage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!isFinite(direction)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Keep direction between -179 and +180.
|
// Keep direction between -179 and +180.
|
||||||
this.direction = MathUtil.wrapClamp(direction, -179, 180);
|
this.direction = MathUtil.wrapClamp(direction, -179, 180);
|
||||||
if (this.renderer) {
|
if (this.renderer) {
|
||||||
|
|
Loading…
Reference in a new issue