diff --git a/src/js/Events.js b/src/js/Events.js index 4467663..dcab8c8 100644 --- a/src/js/Events.js +++ b/src/js/Events.js @@ -75,6 +75,7 @@ var Events = { // Tests MOUSE_EVENT : 'MOUSE_EVENT', KEYBOARD_EVENT : 'KEYBOARD_EVENT', + TRANSFORMATION_EVENT : 'TRANSFORMATION_EVENT', TEST_RECORD_END : 'TEST_RECORD_END', TEST_CASE_END : 'TEST_CASE_END', TEST_SUITE_END : 'TEST_SUITE_END' diff --git a/src/js/controller/TransformationsController.js b/src/js/controller/TransformationsController.js index 3d71a25..56c6f1f 100644 --- a/src/js/controller/TransformationsController.js +++ b/src/js/controller/TransformationsController.js @@ -19,19 +19,24 @@ ns.TransformationsController.prototype.init = function () { var container = document.querySelector('.transformations-container'); this.toolsContainer = container.querySelector('.tools-wrapper'); - container.addEventListener('click', this.onTransformationClick.bind(this)); + container.addEventListener('click', this.onTransformationClick_.bind(this)); this.createToolsDom_(); }; - ns.TransformationsController.prototype.onTransformationClick = function (evt) { - var toolId = evt.target.dataset.toolId; + ns.TransformationsController.prototype.applyTool = function (toolId, evt) { this.tools.forEach(function (tool) { if (tool.instance.toolId === toolId) { + $.publish(Events.TRANSFORMATION_EVENT, [toolId, evt]); tool.instance.apply(evt); } }.bind(this)); }; + ns.TransformationsController.prototype.onTransformationClick_ = function (evt) { + var toolId = evt.target.dataset.toolId; + this.applyTool(toolId, evt); + }; + ns.TransformationsController.prototype.createToolsDom_ = function() { var html = this.tools.reduce(function (p, tool) { return p + this.toolIconRenderer.render(tool.instance, tool.shortcut, 'left'); diff --git a/src/js/devtools/DrawingTestPlayer.js b/src/js/devtools/DrawingTestPlayer.js index 850763c..1a378aa 100644 --- a/src/js/devtools/DrawingTestPlayer.js +++ b/src/js/devtools/DrawingTestPlayer.js @@ -94,6 +94,8 @@ this.playColorEvent_(recordEvent); } else if (recordEvent.type === 'tool-event') { this.playToolEvent_(recordEvent); + } else if (recordEvent.type === 'transformtool-event') { + this.playTransformToolEvent_(recordEvent); } else if (recordEvent.type === 'instrumented-event') { this.playInstrumentedEvent_(recordEvent); } @@ -142,6 +144,10 @@ $.publish(Events.SELECT_TOOL, [recordEvent.toolId]); }; + ns.DrawingTestPlayer.prototype.playTransformToolEvent_ = function (recordEvent) { + pskl.app.transformationsController.applyTool(recordEvent.toolId, recordEvent.event); + }; + ns.DrawingTestPlayer.prototype.playInstrumentedEvent_ = function (recordEvent) { pskl.app.piskelController[recordEvent.methodName].apply(pskl.app.piskelController, recordEvent.args); }; diff --git a/src/js/devtools/DrawingTestRecorder.js b/src/js/devtools/DrawingTestRecorder.js index 5b6c312..f89eecf 100644 --- a/src/js/devtools/DrawingTestRecorder.js +++ b/src/js/devtools/DrawingTestRecorder.js @@ -11,6 +11,7 @@ $.subscribe(Events.MOUSE_EVENT, this.onMouseEvent_.bind(this)); $.subscribe(Events.KEYBOARD_EVENT, this.onKeyboardEvent_.bind(this)); $.subscribe(Events.TOOL_SELECTED, this.onToolEvent_.bind(this)); + $.subscribe(Events.TRANSFORMATION_EVENT, this.onTransformationEvent_.bind(this)); $.subscribe(Events.PRIMARY_COLOR_SELECTED, this.onColorEvent_.bind(this, true)); $.subscribe(Events.SECONDARY_COLOR_SELECTED, this.onColorEvent_.bind(this, false)); @@ -74,17 +75,17 @@ } }; - ns.DrawingTestRecorder.prototype.onKeyboardEvent_ = function (evt, keyboardEvent) { + ns.DrawingTestRecorder.prototype.onKeyboardEvent_ = function (evt, domEvent) { if (this.isRecording) { var recordEvent = {}; recordEvent.type = 'keyboard-event'; recordEvent.event = { - which : keyboardEvent.which, - shiftKey : keyboardEvent.shiftKey, - altKey : keyboardEvent.altKey, - ctrlKey : keyboardEvent.ctrlKey, + which : domEvent.which, + shiftKey : domEvent.shiftKey, + altKey : domEvent.altKey, + ctrlKey : domEvent.ctrlKey, target : { - nodeName : keyboardEvent.target.nodeName + nodeName : domEvent.target.nodeName } }; this.events.push(recordEvent); @@ -110,6 +111,20 @@ } }; + ns.DrawingTestRecorder.prototype.onTransformationEvent_ = function (evt, toolId, domEvent) { + if (this.isRecording) { + var recordEvent = {}; + recordEvent.type = 'transformtool-event'; + recordEvent.toolId = toolId; + recordEvent.event = { + shiftKey : domEvent.shiftKey, + altKey : domEvent.altKey, + ctrlKey : domEvent.ctrlKey + }; + this.events.push(recordEvent); + } + }; + ns.DrawingTestRecorder.prototype.onInstrumentedMethod_ = function (callee, methodName, args) { if (this.isRecording) { var recordEvent = {}; diff --git a/src/js/tools/transform/AbstractTransformTool.js b/src/js/tools/transform/AbstractTransformTool.js index 7dac651..edb4d7a 100644 --- a/src/js/tools/transform/AbstractTransformTool.js +++ b/src/js/tools/transform/AbstractTransformTool.js @@ -8,7 +8,15 @@ ns.AbstractTransformTool.prototype.apply = function (evt) { var allFrames = evt.shiftKey; var allLayers = evt.ctrlKey; + this.applyTool_(evt.altKey, allFrames, allLayers); + + $.publish(Events.PISKEL_RESET); + this.raiseSaveStateEvent_({ + altKey : evt.altKey, + allFrames : allFrames, + allLayers : allLayers + }); }; ns.AbstractTransformTool.prototype.applyTool_ = function (altKey, allFrames, allLayers) { @@ -20,10 +28,18 @@ this.applyToolOnFrame_(frame, altKey); }.bind(this)); }.bind(this)); - $.publish(Events.PISKEL_RESET); + }; + + ns.AbstractTransformTool.prototype.raiseSaveStateEvent_ = function (replayData) { $.publish(Events.PISKEL_SAVE_STATE, { - type : pskl.service.HistoryService.SNAPSHOT + type : pskl.service.HistoryService.REPLAY, + scope : this, + replay : replayData }); }; + ns.AbstractTransformTool.prototype.replay = function (frame, replayData) { + this.applyTool_(replayData.altKey, replayData.allFrames, replayData.allLayers); + }; + })(); diff --git a/src/js/tools/transform/Clone.js b/src/js/tools/transform/Clone.js index 9a6698e..9544068 100644 --- a/src/js/tools/transform/Clone.js +++ b/src/js/tools/transform/Clone.js @@ -9,7 +9,7 @@ pskl.utils.inherit(ns.Clone, ns.AbstractTransformTool); - ns.Clone.prototype.apply = function (evt) { + ns.Clone.prototype.applyTool_ = function (altKey, allFrames, allLayers) { var ref = pskl.app.piskelController.getCurrentFrame(); var layer = pskl.app.piskelController.getCurrentLayer(); layer.getFrames().forEach(function (frame) { @@ -17,9 +17,5 @@ frame.setPixels(ref.getPixels()); } }); - $.publish(Events.PISKEL_RESET); - $.publish(Events.PISKEL_SAVE_STATE, { - type : pskl.service.HistoryService.SNAPSHOT - }); }; })(); diff --git a/test/casperjs/DrawingTest.js b/test/casperjs/DrawingTest.js index 2bb599e..59fa936 100644 --- a/test/casperjs/DrawingTest.js +++ b/test/casperjs/DrawingTest.js @@ -17,11 +17,11 @@ }); casper.then(function () { - this.echo('Waiting for test result : ' + resultSelector); + this.echo('... Waiting for test result : ' + resultSelector); this.waitForSelector(resultSelector, function () { // then var result = this.getHTML(resultSelector); - this.echo('Test finished : ' + result); + this.echo('... Test finished : ' + result); this.test.assertEquals(result, 'OK'); }, function () { // onTimeout diff --git a/test/drawing/DrawingTests.browser.js b/test/drawing/DrawingTests.browser.js index 6692eaf..83cf13d 100644 --- a/test/drawing/DrawingTests.browser.js +++ b/test/drawing/DrawingTests.browser.js @@ -14,5 +14,13 @@ "squares.circles.json", "stroke.json", "verticalpen.drawing.json", - "dithering.basic.json" + "dithering.basic.json", + "transform.clone.once.json", + "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" ]} \ No newline at end of file diff --git a/test/drawing/DrawingTests.casper.js b/test/drawing/DrawingTests.casper.js index 5b9696e..efeaa85 100644 --- a/test/drawing/DrawingTests.casper.js +++ b/test/drawing/DrawingTests.casper.js @@ -5,6 +5,7 @@ "history.basic.json", "layers.fun.json", "layers.merge.json", + "lighten.darken.json", "move.json", "move-alllayers-allframes.json", "pen.secondary.color.json", @@ -12,5 +13,13 @@ "squares.circles.json", "stroke.json", "verticalpen.drawing.json", - "dithering.basic.json" + "dithering.basic.json", + "transform.clone.once.json", + "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" ]; \ No newline at end of file diff --git a/test/drawing/tests/bucket.drawing.json b/test/drawing/tests/bucket.drawing.json index 5a3bae7..a09ee11 100644 --- a/test/drawing/tests/bucket.drawing.json +++ b/test/drawing/tests/bucket.drawing.json @@ -1 +1,654 @@ -{"events":[{"type":"color-event","color":"#00989f","isPrimary":true},{"type":"tool-event","toolId":"tool-pen"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":4},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":4},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":4},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":4},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":1},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":1},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","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"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"type":"color-event","color":"#000c9f","isPrimary":true},{"type":"tool-event","toolId":"tool-paint-bucket"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"type":"tool-event","toolId":"tool-colorswap"},{"type":"color-event","color":"#009f0c","isPrimary":true},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"type":"instrumented-event","methodName":"duplicateFrameAt","args":[0]},{"type":"color-event","color":"#9f0000","isPrimary":true},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"}],"initialState":{"size":{"width":5,"height":5},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-move"},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAFCAYAAAB8ZH1oAAAAPklEQVQIW2Ocz8DwP3E+DwND7mQGhsm5DPMTvzCAALoYI8N8nv9gRTAAVAwGaGKMDDzz/yNU4WYRbyKxbgQAzEEkQG3hX+sAAAAASUVORK5CYII="} \ No newline at end of file +{ + "events": [{ + "type": "color-event", + "color": "#00989f", + "isPrimary": true + }, { + "type": "tool-event", + "toolId": "tool-pen" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "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" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "type": "color-event", + "color": "#000c9f", + "isPrimary": true + }, { + "type": "tool-event", + "toolId": "tool-paint-bucket" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "type": "tool-event", + "toolId": "tool-colorswap" + }, { + "type": "color-event", + "color": "#009f0c", + "isPrimary": true + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "type": "instrumented-event", + "methodName": "duplicateFrameAt", + "args": [0] + }, { + "type": "color-event", + "color": "#9f0000", + "isPrimary": true + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }], + "initialState": { + "size": { + "width": 5, + "height": 5 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-move", + "step" : 100 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAFCAYAAAB8ZH1oAAAAPklEQVQIW2Ocz8DwP3E+DwND7mQGhsm5DPMTvzCAALoYI8N8nv9gRTAAVAwGaGKMDDzz/yNU4WYRbyKxbgQAzEEkQG3hX+sAAAAASUVORK5CYII=" +} diff --git a/test/drawing/tests/lighten.darken.json b/test/drawing/tests/lighten.darken.json index 17f222c..80d1698 100644 --- a/test/drawing/tests/lighten.darken.json +++ b/test/drawing/tests/lighten.darken.json @@ -1 +1,1593 @@ -{"events":[{"type":"tool-event","toolId":"tool-paint-bucket"},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"type":"tool-event","toolId":"tool-lighten"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":4},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":4},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":0,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":0,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":4,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":4,"y":3},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":3,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":1,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":1,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":1,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":1,"y":0},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":0,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":0,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":true,"altKey":false,"ctrlKey":true},"coords":{"x":0,"y":1},"type":"mouse-event"}],"initialState":{"size":{"width":5,"height":5},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-move"},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAARklEQVQIW2PU1dX9//HjRwZ+fn4GGM0I5PxnQAIgSUYbGxtMlUBF/4FGMHh7ezNs3bqV4fLlywxg7SAtcnJyDI8ePQKbCwDi5B7DVPJoXAAAAABJRU5ErkJggg=="} \ No newline at end of file +{ + "events": [{ + "type": "tool-event", + "toolId": "tool-paint-bucket" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "type": "tool-event", + "toolId": "tool-lighten" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 4, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 3, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 4 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 2, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 0, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 0, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 4, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 4, + "y": 3 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 3, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 3, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 3, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 3, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 4, + "y": 2 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": true, + "altKey": false, + "ctrlKey": true + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }], + "initialState": { + "size": { + "width": 5, + "height": 5 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-move", + "step" : 100 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAARklEQVQIW2PU1dX9//HjRwZ+fn4GGM0I5PxnQAIgSUYbGxtMlUBF/4FGMHh7ezNs3bqV4fLlywxg7SAtcnJyDI8ePQKbCwDi5B7DVPJoXAAAAABJRU5ErkJggg==" +} diff --git a/test/drawing/tests/transform.clone.once.json b/test/drawing/tests/transform.clone.once.json new file mode 100644 index 0000000..0a1da5f --- /dev/null +++ b/test/drawing/tests/transform.clone.once.json @@ -0,0 +1,86 @@ +{ + "events": [{ + "type": "instrumented-event", + "methodName": "duplicateFrameAt", + "args": [0] + }, { + "type": "instrumented-event", + "methodName": "createLayer", + "args": [] + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "type": "instrumented-event", + "methodName": "setCurrentLayerIndex", + "args": [0] + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "type": "transformtool-event", + "toolId": "tool-clone", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }], + "initialState": { + "size": { + "width": 2, + "height": 2 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-pen", + "step" : 100 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAAFklEQVQIW2NkQAX/GRkYGP4zMDDAaQAkOwMC7/zdVgAAAABJRU5ErkJggg==" +} diff --git a/test/drawing/tests/transform.clone.twice.undo.once.json b/test/drawing/tests/transform.clone.twice.undo.once.json new file mode 100644 index 0000000..a15f3ef --- /dev/null +++ b/test/drawing/tests/transform.clone.twice.undo.once.json @@ -0,0 +1,187 @@ +{ + "events": [{ + "type": "instrumented-event", + "methodName": "duplicateFrameAt", + "args": [0] + }, { + "type": "instrumented-event", + "methodName": "createLayer", + "args": [] + }, { + "type": "instrumented-event", + "methodName": "createLayer", + "args": [] + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, { + "type": "instrumented-event", + "methodName": "setCurrentLayerIndex", + "args": [1] + }, { + "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": "instrumented-event", + "methodName": "setCurrentLayerIndex", + "args": [0] + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 1 + }, + "type": "mouse-event" + }, { + "type": "transformtool-event", + "toolId": "tool-clone", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, { + "type": "instrumented-event", + "methodName": "setCurrentLayerIndex", + "args": [1] + }, { + "type": "transformtool-event", + "toolId": "tool-clone", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, { + "type": "keyboard-event", + "event": { + "which": 90, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "keyboard-event", + "event": { + "which": 38, + "shiftKey": false, + "altKey": false, + "ctrlKey": false, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "tool-event", + "toolId": "tool-stroke" + }, { + "type": "color-event", + "color": "#ff0000", + "isPrimary": true + }, { + "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" + }], + "initialState": { + "size": { + "width": 2, + "height": 2 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-pen", + "step" : 100 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAAHElEQVQIW2P8z8Dwn5GBgZGBgeE/AwOCARNgBABnLwUCTlSTegAAAABJRU5ErkJggg==" +} diff --git a/test/drawing/tests/transform.flip.once.alt.json b/test/drawing/tests/transform.flip.once.alt.json new file mode 100644 index 0000000..fac8dd1 --- /dev/null +++ b/test/drawing/tests/transform.flip.once.alt.json @@ -0,0 +1 @@ +{"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-flip","event":{"shiftKey":false,"altKey":true,"ctrlKey":false}}],"initialState":{"size":{"width":2,"height":2},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen"},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2NkgAJGBgaG/wwMDIwABSkBAyQtNbwAAAAASUVORK5CYII="} \ No newline at end of file diff --git a/test/drawing/tests/transform.flip.thrice.undo.all.redo.all.json b/test/drawing/tests/transform.flip.thrice.undo.all.redo.all.json new file mode 100644 index 0000000..233becd --- /dev/null +++ b/test/drawing/tests/transform.flip.thrice.undo.all.redo.all.json @@ -0,0 +1,135 @@ +{ + "events": [{ + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 0 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mousemove", + "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-flip", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, { + "type": "transformtool-event", + "toolId": "tool-flip", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, { + "type": "keyboard-event", + "event": { + "which": 90, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "keyboard-event", + "event": { + "which": 90, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "keyboard-event", + "event": { + "which": 90, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "keyboard-event", + "event": { + "which": 89, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "keyboard-event", + "event": { + "which": 89, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "keyboard-event", + "event": { + "which": 89, + "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,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2NkYGD4z8DAwMjIAAUADikBA/ggJToAAAAASUVORK5CYII=" +} diff --git a/test/drawing/tests/transform.flip.twice.undo.once.json b/test/drawing/tests/transform.flip.twice.undo.once.json new file mode 100644 index 0000000..fad052a --- /dev/null +++ b/test/drawing/tests/transform.flip.twice.undo.once.json @@ -0,0 +1,100 @@ +{ + "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-flip", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, { + "type": "transformtool-event", + "toolId": "tool-flip", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, { + "type": "keyboard-event", + "event": { + "which": 90, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "tool-event", + "toolId": "tool-stroke" + }, { + "type": "color-event", + "color": "#ff0000", + "isPrimary": true + }, { + "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" + }], + "initialState": { + "size": { + "width": 2, + "height": 2 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-pen", + "step" : 100 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2P8z8Dwn5GBgQGEwQAAHxsCAoill14AAAAASUVORK5CYII=" +} 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 0000000..f3f6ff1 --- /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==" +} diff --git a/test/drawing/tests/transform.rotate.once.alt.json b/test/drawing/tests/transform.rotate.once.alt.json new file mode 100644 index 0000000..e7381a9 --- /dev/null +++ b/test/drawing/tests/transform.rotate.once.alt.json @@ -0,0 +1 @@ +{"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}}],"initialState":{"size":{"width":2,"height":2},"primaryColor":"#ff0000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-stroke"},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFUlEQVQIW2NkYGBg+M/A8J8RxAABABcWAgFMzp95AAAAAElFTkSuQmCC"} \ No newline at end of file diff --git a/test/drawing/tests/transform.rotate.twice.undo.once.json b/test/drawing/tests/transform.rotate.twice.undo.once.json new file mode 100644 index 0000000..b400a25 --- /dev/null +++ b/test/drawing/tests/transform.rotate.twice.undo.once.json @@ -0,0 +1,100 @@ +{ + "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": false, + "ctrlKey": false + } + }, { + "type": "transformtool-event", + "toolId": "tool-rotate", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, { + "type": "keyboard-event", + "event": { + "which": 90, + "shiftKey": false, + "altKey": false, + "ctrlKey": true, + "target": { + "nodeName": "BODY" + } + } + }, { + "type": "tool-event", + "toolId": "tool-stroke" + }, { + "type": "color-event", + "color": "#ff0000", + "isPrimary": true + }, { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 1 + }, + "type": "mouse-event" + }, { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 1 + }, + "type": "mouse-event" + }], + "initialState": { + "size": { + "width": 2, + "height": 2 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-pen", + "step" : 100 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAE0lEQVQIW2NkgAJGBgaG//+BHAAJJAIBS+4zcQAAAABJRU5ErkJggg==" +}