From 043f077408cad7e816a7ba4caae72d3fcd051df3 Mon Sep 17 00:00:00 2001 From: jdescottes Date: Wed, 24 Dec 2014 08:27:54 +0100 Subject: [PATCH] Bug in undo when cancelling Shape tool used with Shift key --- src/js/controller/PreviewFilmController.js | 1 + src/js/tools/drawing/ShapeTool.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/controller/PreviewFilmController.js b/src/js/controller/PreviewFilmController.js index 47777a1d..89446370 100644 --- a/src/js/controller/PreviewFilmController.js +++ b/src/js/controller/PreviewFilmController.js @@ -169,6 +169,7 @@ var width = this.zoom * this.piskelController.getCurrentFrame().getWidth(); var verticalMargin = (Constants.PREVIEW_FILM_SIZE - width) / 2; canvasContainer.style.marginLeft = verticalMargin + 'px'; + canvasContainer.style.marginRight = verticalMargin + 'px'; var canvasBackground = document.createElement("div"); diff --git a/src/js/tools/drawing/ShapeTool.js b/src/js/tools/drawing/ShapeTool.js index 771a70e6..461a5fc0 100644 --- a/src/js/tools/drawing/ShapeTool.js +++ b/src/js/tools/drawing/ShapeTool.js @@ -49,10 +49,10 @@ var coords = this.getCoordinates_(col, row, event); this.draw_(coords.col, coords.row, color, frame); - $.publish(Events.DRAG_END, [col, row]); + $.publish(Events.DRAG_END, [coords.col, coords.row]); this.raiseSaveStateEvent({ - col : col, - row : row, + col : coords.col, + row : coords.row, startCol : this.startCol, startRow : this.startRow, color : color