VectorPaint: fixed initial rendering

so costumes can be re-opened after saving / exporting and re-loading the project
upd4.2
jmoenig 2018-06-05 15:05:32 +02:00
rodzic 9dde6a4fd8
commit 7bf5bf9ff7
2 zmienionych plików z 11 dodań i 6 usunięć

Wyświetl plik

@ -4123,3 +4123,4 @@ in development:
180605
------
* VectorPaint: fixed rotation center editing for existing costumes
* VectorPaint: fixed initial rendering, so costumes can be re-opened after saving

Wyświetl plik

@ -46,8 +46,10 @@
Bernat Romagosa rewrote most of the code in 2017
revision history
----------------
2018, June 5 - fixed initial rotation center for an existing costume (Jens)
-----------------
2018, June 5
- fixed initial rotation center for an existing costume (Jens)
- fixed initial rendering, so costumes can be re-opened after saving
*/
/*global Point, Object, Rectangle, AlignmentMorph, Morph, XML_Element, nop,
@ -995,17 +997,19 @@ VectorPaintEditorMorph.prototype.openIn = function (world, oldim, oldrc, callbac
isEmpty = isNil(shapes) || shapes.length === 0;
VectorPaintEditorMorph.uber.openIn.call(this, world, null, oldrc, callback);
this.shapes = shapes.map(function (eachShape) { return eachShape.copy(); });
this.ide = anIDE;
this.paper.drawNew();
this.paper.changed();
// make sure shapes are initialized and can be rendered
shapes.forEach(function (shape) {
shape.drawOn(myself.paper);
});
// copy the shapes for editing and re-render the copies
this.shapes = shapes.map(function (eachShape) { return eachShape.copy(); });
this.shapes.forEach(function (shape) {
shape.drawOn(myself.paper);
});
// init the rotation center, if any
if (oldrc && !isEmpty) {
this.paper.automaticCrosshairs = false;