mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Uses ImageResizer for spritesheet export scaling.
This commit is contained in:
parent
c0fda032e5
commit
bd8eaa4307
@ -24,7 +24,17 @@
|
|||||||
|
|
||||||
ns.PngExportController.prototype.onPngDownloadButtonClick_ = function (evt) {
|
ns.PngExportController.prototype.onPngDownloadButtonClick_ = function (evt) {
|
||||||
var fileName = this.getPiskelName_() + '.png';
|
var fileName = this.getPiskelName_() + '.png';
|
||||||
pskl.utils.BlobUtils.canvasToBlob(this.getFramesheetAsCanvas(), function(blob) {
|
|
||||||
|
var outputCanvas = this.getFramesheetAsCanvas();
|
||||||
|
|
||||||
|
var scalingFactor = pskl.UserSettings.get(pskl.UserSettings.EXPORT_SCALING);
|
||||||
|
if (scalingFactor > 1) {
|
||||||
|
var width = outputCanvas.width * scalingFactor;
|
||||||
|
var height = outputCanvas.height * scalingFactor;
|
||||||
|
outputCanvas = pskl.utils.ImageResizer.resize(outputCanvas, width, height, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
pskl.utils.BlobUtils.canvasToBlob(outputCanvas, function(blob) {
|
||||||
pskl.utils.FileUtils.downloadAsFile(blob, fileName);
|
pskl.utils.FileUtils.downloadAsFile(blob, fileName);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user