Issue #414: part10: support opacity in preview renderers

This commit is contained in:
juliandescottes
2016-03-20 22:38:39 +01:00
parent 99b00bc57f
commit 327df539a7
14 changed files with 189 additions and 79 deletions

View File

@ -56,19 +56,16 @@
// 3 - set the source of the image
image.src = base64PNG;
// 4 - return a pointer to the new layer instance
return layer;
};
ns.Deserializer.prototype.loadExpandedLayer = function (layerData, index) {
var layer = new pskl.model.Layer(layerData.name);
layer.setOpacity(layerData.opacity);
var frames = layerData.grids.map(function (grid) {
return pskl.model.Frame.fromPixelGrid(grid);
});
this.addFramesToLayer(frames, layer, index);
// 4 - return a pointer to the new layer instance
return layer;
};