mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Issue #414: part5: rename PiskelController getFrameAt to getMergedFrameAt
This commit is contained in:
parent
186b5a305a
commit
d2dc42e7cf
@ -203,7 +203,7 @@
|
||||
},
|
||||
|
||||
getFirstFrameAsPng : function () {
|
||||
var firstFrame = this.piskelController.getFrameAt(0);
|
||||
var firstFrame = this.piskelController.getMergedFrameAt(0);
|
||||
var firstFrameCanvas = pskl.utils.FrameUtils.toImage(firstFrame);
|
||||
return firstFrameCanvas.toDataURL('image/png');
|
||||
},
|
||||
|
@ -90,7 +90,7 @@
|
||||
return this.piskel;
|
||||
};
|
||||
|
||||
ns.PiskelController.prototype.getFrameAt = function (index) {
|
||||
ns.PiskelController.prototype.getMergedFrameAt = function (index) {
|
||||
var hash = [];
|
||||
var frames = this.getLayers().map(function (l) {
|
||||
var frame = l.getFrameAt(index);
|
||||
|
@ -170,7 +170,7 @@
|
||||
var index = this.getNextIndex_(delta);
|
||||
if (this.shoudlRender_() || this.currentIndex != index) {
|
||||
this.currentIndex = index;
|
||||
var frame = this.piskelController.getFrameAt(this.currentIndex);
|
||||
var frame = this.piskelController.getMergedFrameAt(this.currentIndex);
|
||||
this.renderer.render(frame);
|
||||
this.renderFlag = false;
|
||||
|
||||
|
@ -127,7 +127,7 @@
|
||||
});
|
||||
|
||||
for (var i = 0 ; i < this.piskelController.getFrameCount() ; i++) {
|
||||
var frame = this.piskelController.getFrameAt(i);
|
||||
var frame = this.piskelController.getMergedFrameAt(i);
|
||||
var canvasRenderer = new pskl.rendering.CanvasRenderer(frame, zoom);
|
||||
if (preserveColors) {
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
||||
ns.PngExportController.prototype.mergedExport_ = function (zip) {
|
||||
var paddingLength = ('' + this.piskelController.getFrameCount()).length;
|
||||
for (var i = 0; i < this.piskelController.getFrameCount(); i++) {
|
||||
var frame = this.piskelController.getFrameAt(i);
|
||||
var frame = this.piskelController.getMergedFrameAt(i);
|
||||
var canvas = this.getFrameAsCanvas_(frame);
|
||||
var basename = this.pngFilePrefixInput.value;
|
||||
var id = pskl.utils.StringUtils.leftPad(i, paddingLength, '0');
|
||||
|
@ -5,7 +5,7 @@
|
||||
ns.PiskelRenderer = function (piskelController) {
|
||||
var frames = [];
|
||||
for (var i = 0 ; i < piskelController.getFrameCount() ; i++) {
|
||||
frames.push(piskelController.getFrameAt(i));
|
||||
frames.push(piskelController.getMergedFrameAt(i));
|
||||
}
|
||||
ns.FramesheetRenderer.call(this, frames);
|
||||
};
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
serializeLayer : function (layer, expanded) {
|
||||
var frames = layer.getFrames();
|
||||
var renderer = new pskl.rendering.FramesheetRenderer(frames);
|
||||
var layerToSerialize = {
|
||||
name : layer.getName(),
|
||||
opacity : layer.getOpacity(),
|
||||
@ -32,6 +31,7 @@
|
||||
layerToSerialize.grids = frames.map(function (f) {return f.pixels;});
|
||||
return layerToSerialize;
|
||||
} else {
|
||||
var renderer = new pskl.rendering.FramesheetRenderer(frames);
|
||||
layerToSerialize.base64PNG = renderer.renderAsCanvas().toDataURL();
|
||||
return JSON.stringify(layerToSerialize);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user