confine turtle direction readout to 0-360 degrees

addresses a bug report from Cynthia Solomon
upd4.1
Jens Mönig 2017-07-07 16:06:46 +02:00
rodzic 5efc59acab
commit de29bffe15
3 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -3509,6 +3509,7 @@ Fixes:
------ ------
* Objects, GUI, Store: tweak naming of instantiating to “clone”, enable inheritance by default * Objects, GUI, Store: tweak naming of instantiating to “clone”, enable inheritance by default
* Objects, GUI: run “When I start as clone” scripts when manually cloning a sprite, only position at hand pointer if no such scripts exist * Objects, GUI: run “When I start as clone” scripts when manually cloning a sprite, only position at hand pointer if no such scripts exist
* Morphic, Objects: confine turtle direction readout to 0-360 degrees, thanks, Cynthia for the bug report!!
Features: Features:

Wyświetl plik

@ -1161,7 +1161,7 @@
/*global window, HTMLCanvasElement, FileReader, Audio, FileList*/ /*global window, HTMLCanvasElement, FileReader, Audio, FileList*/
var morphicVersion = '2017-July-04'; var morphicVersion = '2017-July-07';
var modules = {}; // keep track of additional loaded modules var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug
@ -4838,7 +4838,7 @@ PenMorph.prototype.drawNew = function (facing) {
// PenMorph access: // PenMorph access:
PenMorph.prototype.setHeading = function (degrees) { PenMorph.prototype.setHeading = function (degrees) {
this.heading = parseFloat(degrees) % 360; this.heading = ((+degrees % 360) + 360) % 360;
this.drawNew(); this.drawNew();
this.changed(); this.changed();
}; };

Wyświetl plik

@ -4262,7 +4262,7 @@ SpriteMorph.prototype.setHeading = function (degrees, noShadow) {
this.silentGotoXY(x, y, true); // just me this.silentGotoXY(x, y, true); // just me
this.positionTalkBubble(); this.positionTalkBubble();
} else { } else {
this.heading = parseFloat(degrees) % 360; this.heading = ((+degrees % 360) + 360) % 360;
} }
// propagate to my parts // propagate to my parts