don't do arc for zero

pull/122/head
Michael 2022-08-25 15:42:09 +02:00
rodzic 0a38192b3d
commit 354d1fd7a8
2 zmienionych plików z 8 dodań i 6 usunięć

Wyświetl plik

@ -46,9 +46,9 @@
<script type="text/javascript" src="stitchcode/symbols.js?version=2021-12-14"></script>
<script type="text/javascript" src="stitchcode/blocks.js?version=2021-12-14"></script>
<script type="text/javascript" src="stitchcode/threads.js?version=2021-12-14"></script>
<script type="text/javascript" src="stitchcode/objects.js?version=2022-08-25"></script>
<script type="text/javascript" src="stitchcode/objects.js?version=2022-08-25-"></script>
<script type="text/javascript" src="stitchcode/turtlecloud.js?version=2022-06-14"></script>
<script type="text/javascript" src="stitchcode/gui.js?version=2022-08-05"></script>
<script type="text/javascript" src="stitchcode/gui.js?version=2022-08-25"></script>
<script type="text/javascript" src="stitchcode/store.js?version=2022-06-14"></script>
<script type="text/javascript">

Wyświetl plik

@ -504,9 +504,10 @@ SpriteMorph.prototype.arcRight = function (radius, degrees) {
this.forward((radius * 0.174532) / (10.0 / (degrees % 10)))
this.turn((degrees % 10)/2.0 )
}
} else {
// throw new Error('degrees must be positive');
} else if (degrees < 0) {
this.arcLeft(radius, Math.abs(degrees))
} else {
throw new Error('degrees must not be zero');
}
};
@ -523,9 +524,10 @@ SpriteMorph.prototype.arcLeft = function (radius, degrees) {
this.forward((radius * 0.174532) / (10.0 / (degrees % 10)))
this.turn(-((degrees % 10)/2.0))
}
} else {
//throw new Error('degrees must be positive');
} else if (degrees < 0) {
this.arcRight(radius, Math.abs(degrees))
} else {
throw new Error('degrees must not be zero');
}
};