limited sprites' direction and coordinates to finite numbers

upd4.1
Jens Mönig 2017-10-04 09:02:44 +02:00
rodzic 51998503a3
commit 385ca6f891
2 zmienionych plików z 11 dodań i 4 usunięć

Wyświetl plik

@ -3673,6 +3673,10 @@ Fixes:
* new "Animation" library
* new "Pixels" library for MediaComp
171004
------
* Objects: limited sprites' direction and coordinates to finite numbers
v4.1 Features:
* polymorphic sprite-local custom blocks
@ -3721,3 +3725,4 @@ Fixes:
* fixed “fill” block crash when applying the same color twice
* fixed occasional empty drop-down menu items named “close”
* fixed some typos
* limited sprites' direction and coordinates to finite numbers

Wyświetl plik

@ -83,7 +83,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph,
AlignmentMorph*/
modules.objects = '2017-September-28';
modules.objects = '2017-October-04';
var SpriteMorph;
var StageMorph;
@ -4447,7 +4447,7 @@ SpriteMorph.prototype.forward = function (steps) {
SpriteMorph.prototype.setHeading = function (degrees, noShadow) {
var x = this.xPosition(),
y = this.yPosition(),
dir = (+degrees || 0),
dir = !isFinite(degrees) ? 0 : +degrees,
turn = dir - this.heading;
// apply to myself
@ -4556,8 +4556,10 @@ SpriteMorph.prototype.gotoXY = function (x, y, justMe, noShadow) {
this.shadowAttribute('x position');
this.shadowAttribute('y position');
}
newX = stage.center().x + (+x || 0) * stage.scale;
newY = stage.center().y - (+y || 0) * stage.scale;
x = !isFinite(+x) ? 0 : +x;
y = !isFinite(+y) ? 0 : +y;
newX = stage.center().x + x * stage.scale;
newY = stage.center().y - y * stage.scale;
if (this.costume) {
dest = new Point(newX, newY).subtract(this.rotationOffset);
} else {