fixed serialization placement-bug for sprites

thanks, Caitie, for reporting this bug and for supplying a project
which let me reproduce it!
pull/3/merge
jmoenig 2013-07-08 08:19:19 +02:00
rodzic 3314477dc2
commit 09fb8f7f82
2 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -1786,3 +1786,7 @@ ______
130705 130705
------ ------
* Blocks: fixed CommentMorph hiding/showing bug when switching to / from presentation mode * Blocks: fixed CommentMorph hiding/showing bug when switching to / from presentation mode
130708
------
* Store: fixed serialization placement-bug for sprites

Wyświetl plik

@ -61,7 +61,7 @@ SyntaxElementMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.store = '2013-July-04'; modules.store = '2013-July-08';
// XML_Serializer /////////////////////////////////////////////////////// // XML_Serializer ///////////////////////////////////////////////////////
@ -1349,11 +1349,8 @@ StageMorph.prototype.toXML = function (serializer) {
SpriteMorph.prototype.toXML = function (serializer) { SpriteMorph.prototype.toXML = function (serializer) {
var stage = this.parentThatIsA(StageMorph), var stage = this.parentThatIsA(StageMorph),
position = stage ?
this.center().subtract(stage.center()) : this.center(),
ide = stage ? stage.parentThatIsA(IDE_Morph) : null, ide = stage ? stage.parentThatIsA(IDE_Morph) : null,
idx = ide ? ide.sprites.asArray().indexOf(this) + 1 : 0; idx = ide ? ide.sprites.asArray().indexOf(this) + 1 : 0;
return serializer.format( return serializer.format(
'<sprite name="@" idx="@" x="@" y="@"' + '<sprite name="@" idx="@" x="@" y="@"' +
' heading="@"' + ' heading="@"' +
@ -1370,8 +1367,8 @@ SpriteMorph.prototype.toXML = function (serializer) {
'</sprite>', '</sprite>',
this.name, this.name,
idx, idx,
position.x, this.xPosition(),
-position.y, this.yPosition(),
this.heading, this.heading,
this.scale, this.scale,
this.rotationStyle, this.rotationStyle,