From dc78c3cecdb5d6cbacbde7d3f61905e8286f613f Mon Sep 17 00:00:00 2001 From: jdescottes Date: Mon, 14 Jul 2014 00:37:17 +0200 Subject: [PATCH] Yet another history bug ! --- src/js/selection/SelectionManager.js | 8 ++++---- src/piskel-script-list.js | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/js/selection/SelectionManager.js b/src/js/selection/SelectionManager.js index 4a736a9d..2088b36a 100644 --- a/src/js/selection/SelectionManager.js +++ b/src/js/selection/SelectionManager.js @@ -103,6 +103,10 @@ ns.SelectionManager.prototype.pastePixels = function(pixels) { var currentFrame = this.piskelController.getCurrentFrame(); + pixels.forEach(function (pixel) { + currentFrame.setPixel(pixel.col,pixel.row,pixel.color); + }); + $.publish(Events.PISKEL_SAVE_STATE, { type : pskl.service.HistoryService.REPLAY, scope : this, @@ -111,10 +115,6 @@ pixels : JSON.parse(JSON.stringify(pixels.slice(0))) } }); - - pixels.forEach(function (pixel) { - currentFrame.setPixel(pixel.col,pixel.row,pixel.color); - }); }; ns.SelectionManager.prototype.replay = function (frame, replayData) { diff --git a/src/piskel-script-list.js b/src/piskel-script-list.js index de1cdace..b91b8896 100644 --- a/src/piskel-script-list.js +++ b/src/piskel-script-list.js @@ -8,7 +8,6 @@ "js/Constants.js", "js/Events.js", - // Libraries "js/utils/core.js", "js/utils/UserAgent.js",