From a0c9f2923eba5a683ae36afcc182b6bc3a9a07c9 Mon Sep 17 00:00:00 2001 From: jdescottes Date: Fri, 2 Oct 2015 02:04:03 +0200 Subject: [PATCH] Issue #315 : Fix replay with alt/shift/ctrl modifiers --- .../tools/transform/AbstractTransformTool.js | 2 +- test/drawing/DrawingTests.browser.js | 1 + test/drawing/DrawingTests.casper.js | 1 + .../transform.rotate.alt.twice.undo.once.json | 67 +++++++++++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 test/drawing/tests/transform.rotate.alt.twice.undo.once.json diff --git a/src/js/tools/transform/AbstractTransformTool.js b/src/js/tools/transform/AbstractTransformTool.js index 780412a8..edb4d7a5 100644 --- a/src/js/tools/transform/AbstractTransformTool.js +++ b/src/js/tools/transform/AbstractTransformTool.js @@ -38,7 +38,7 @@ }); }; - ns.AbstractTransformTool.prototype.replay = function (replayData) { + ns.AbstractTransformTool.prototype.replay = function (frame, replayData) { this.applyTool_(replayData.altKey, replayData.allFrames, replayData.allLayers); }; diff --git a/test/drawing/DrawingTests.browser.js b/test/drawing/DrawingTests.browser.js index 195b8147..83cf13d4 100644 --- a/test/drawing/DrawingTests.browser.js +++ b/test/drawing/DrawingTests.browser.js @@ -19,6 +19,7 @@ "transform.clone.twice.undo.once.json", "transform.rotate.once.alt.json", "transform.rotate.twice.undo.once.json", + "transform.rotate.alt.twice.undo.once.json", "transform.flip.once.alt.json", "transform.flip.twice.undo.once.json", "transform.flip.thrice.undo.all.redo.all.json" diff --git a/test/drawing/DrawingTests.casper.js b/test/drawing/DrawingTests.casper.js index 59d54d65..efeaa853 100644 --- a/test/drawing/DrawingTests.casper.js +++ b/test/drawing/DrawingTests.casper.js @@ -18,6 +18,7 @@ "transform.clone.twice.undo.once.json", "transform.rotate.once.alt.json", "transform.rotate.twice.undo.once.json", + "transform.rotate.alt.twice.undo.once.json", "transform.flip.once.alt.json", "transform.flip.twice.undo.once.json", "transform.flip.thrice.undo.all.redo.all.json" diff --git a/test/drawing/tests/transform.rotate.alt.twice.undo.once.json b/test/drawing/tests/transform.rotate.alt.twice.undo.once.json new file mode 100644 index 00000000..f3f6ff1e --- /dev/null +++ b/test/drawing/tests/transform.rotate.alt.twice.undo.once.json @@ -0,0 +1,67 @@ +{ + "events": [{ + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "type": "transformtool-event", + "toolId": "tool-rotate", + "event": { + "shiftKey": false, + "altKey": true, + "ctrlKey": false + } + }, { + "type": "transformtool-event", + "toolId": "tool-rotate", + "event": { + "shiftKey": false, + "altKey": true, + "ctrlKey": false + } + }, { + "type": "keyboard-event", + "event": { + "which": 90, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }], + "initialState": { + "size": { + "width": 2, + "height": 2 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-pen", + "step": 100 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVQIW2NkgID/jFAGAwAKIwECc3hvCQAAAABJRU5ErkJggg==" +}