+
diff --git a/test/drawing/DrawingTests.pensize.js b/test/drawing/DrawingTests.pensize.js
new file mode 100644
index 00000000..b422eec6
--- /dev/null
+++ b/test/drawing/DrawingTests.pensize.js
@@ -0,0 +1,12 @@
+{"tests" : [
+ "pensize.circle.basic.json",
+ "pensize.circle.undo.json",
+ "pensize.eraser.basic.json",
+ "pensize.eraser.undo.json",
+ "pensize.pen.basic.json",
+ "pensize.pen.undo.json",
+ "pensize.rectangle.basic.json",
+ "pensize.rectangle.undo.json",
+ "pensize.stroke.basic.json",
+ "pensize.stroke.undo.json"
+]}
\ No newline at end of file
diff --git a/test/drawing/tests/lighten.darken.json b/test/drawing/tests/lighten.darken.json
index 80d16984..2e065606 100644
--- a/test/drawing/tests/lighten.darken.json
+++ b/test/drawing/tests/lighten.darken.json
@@ -11,8 +11,8 @@
"ctrlKey": false
},
"coords": {
- "x": 0,
- "y": 1
+ "x": 2,
+ "y": 2
},
"type": "mouse-event"
}, {
@@ -24,8 +24,8 @@
"ctrlKey": false
},
"coords": {
- "x": 0,
- "y": 1
+ "x": 2,
+ "y": 2
},
"type": "mouse-event"
}, {
@@ -122,98 +122,10 @@
"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"
- }, {
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
"event": {
"type": "mousedown",
"button": 0,
@@ -304,7 +216,10 @@
"y": 0
},
"type": "mouse-event"
- }, {
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
"event": {
"type": "mousedown",
"button": 0,
@@ -314,513 +229,6 @@
},
"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"
@@ -837,58 +245,6 @@
"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",
@@ -899,7 +255,7 @@
},
"coords": {
"x": 1,
- "y": 4
+ "y": 0
},
"type": "mouse-event"
}, {
@@ -912,7 +268,7 @@
},
"coords": {
"x": 2,
- "y": 4
+ "y": 0
},
"type": "mouse-event"
}, {
@@ -925,7 +281,7 @@
},
"coords": {
"x": 3,
- "y": 4
+ "y": 0
},
"type": "mouse-event"
}, {
@@ -938,7 +294,7 @@
},
"coords": {
"x": 4,
- "y": 4
+ "y": 0
},
"type": "mouse-event"
}, {
@@ -951,400 +307,13 @@
},
"coords": {
"x": 4,
- "y": 4
+ "y": 0
},
"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"
- }, {
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
"event": {
"type": "mousedown",
"button": 0,
@@ -1353,104 +322,26 @@
"ctrlKey": true
},
"coords": {
- "x": 0,
- "y": 3
+ "x": 2,
+ "y": 0
},
"type": "mouse-event"
}, {
"event": {
- "type": "mouseup",
+ "type": "mousemove",
"button": 0,
"shiftKey": true,
"altKey": false,
"ctrlKey": true
},
"coords": {
- "x": 0,
- "y": 3
+ "x": 2,
+ "y": 0
},
"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",
+ "type": "mousemove",
"button": 0,
"shiftKey": true,
"altKey": false,
@@ -1461,6 +352,19 @@
"y": 0
},
"type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mousemove",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": true
+ },
+ "coords": {
+ "x": 0,
+ "y": 0
+ },
+ "type": "mouse-event"
}, {
"event": {
"type": "mouseup",
@@ -1469,12 +373,189 @@
"altKey": false,
"ctrlKey": true
},
+ "coords": {
+ "x": 0,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"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": "mouseup",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 0,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
"coords": {
"x": 1,
"y": 0
},
"type": "mouse-event"
}, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 1,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 1,
+ "y": 0
+ },
+ "type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 1,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
"event": {
"type": "mousedown",
"button": 0,
@@ -1483,7 +564,7 @@
"ctrlKey": true
},
"coords": {
- "x": 3,
+ "x": 2,
"y": 0
},
"type": "mouse-event"
@@ -1496,11 +577,43 @@
"ctrlKey": true
},
"coords": {
- "x": 3,
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": true
+ },
+ "coords": {
+ "x": 2,
"y": 0
},
"type": "mouse-event"
}, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": true,
+ "altKey": false,
+ "ctrlKey": true
+ },
+ "coords": {
+ "x": 2,
+ "y": 0
+ },
+ "type": "mouse-event"
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
"event": {
"type": "mousedown",
"button": 0,
@@ -1509,8 +622,8 @@
"ctrlKey": true
},
"coords": {
- "x": 0,
- "y": 2
+ "x": 2,
+ "y": 0
},
"type": "mouse-event"
}, {
@@ -1522,11 +635,14 @@
"ctrlKey": true
},
"coords": {
- "x": 0,
- "y": 2
+ "x": 2,
+ "y": 0
},
"type": "mouse-event"
- }, {
+ },
+ {"type":"tool-event","toolId":"tool-colorpicker"},
+ {"type":"tool-event","toolId":"tool-lighten"},
+ {
"event": {
"type": "mousedown",
"button": 0,
@@ -1535,8 +651,8 @@
"ctrlKey": true
},
"coords": {
- "x": 4,
- "y": 2
+ "x": 2,
+ "y": 0
},
"type": "mouse-event"
}, {
@@ -1548,36 +664,21 @@
"ctrlKey": true
},
"coords": {
- "x": 4,
- "y": 2
+ "x": 2,
+ "y": 0
},
"type": "mouse-event"
}, {
+ "type": "keyboard-event",
"event": {
- "type": "mousedown",
- "button": 0,
- "shiftKey": true,
+ "which": 90,
+ "shiftKey": false,
"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"
+ "ctrlKey": true,
+ "target": {
+ "nodeName": "BODY"
+ }
+ }
}],
"initialState": {
"size": {
@@ -1586,8 +687,7 @@
},
"primaryColor": "#000000",
"secondaryColor": "rgba(0, 0, 0, 0)",
- "selectedTool": "tool-move",
- "step" : 100
+ "selectedTool": "tool-pen"
},
- "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAARklEQVQIW2PU1dX9//HjRwZ+fn4GGM0I5PxnQAIgSUYbGxtMlUBF/4FGMHh7ezNs3bqV4fLlywxg7SAtcnJyDI8ePQKbCwDi5B7DVPJoXAAAAABJRU5ErkJggg=="
+ "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAI0lEQVQIW2PU1dX9z8/Pz/Do0SMGEA0CjAwMDP/BLCRAoSAAeuwIiFt0t6sAAAAASUVORK5CYII="
}
diff --git a/test/drawing/tests/pensize.circle.basic.json b/test/drawing/tests/pensize.circle.basic.json
new file mode 100644
index 00000000..af2a2f0c
--- /dev/null
+++ b/test/drawing/tests/pensize.circle.basic.json
@@ -0,0 +1 @@
+{"events":[{"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":"mousemove","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":1,"y":1},"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":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","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":2,"y":3},"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":"pensize-event","penSize":2},{"type":"color-event","color":"#2d2dbd","isPrimary":true},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","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":4,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"type":"color-event","color":"#ff9100","isPrimary":true},{"type":"pensize-event","penSize":3},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":9},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":9},"type":"mouse-event"},{"type":"color-event","color":"#31a626","isPrimary":true},{"type":"pensize-event","penSize":4},{"event":{"type":"mousedown","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":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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":9},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":9},"type":"mouse-event"}],"initialState":{"size":{"width":12,"height":12},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-circle","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAd0lEQVQoU2NkYGBg+M/A8J+RgYERxNbV3fsfRMPA5cvOYHEYYIQpBtF6unsZWCozkeXh7PNRt8AawQRMk+EyNRTT0XWCNEE0TGT4bySqhtVkdEFGkGKQIP01nHt9C+wadJsH0Em4ggwerMSEFDwekE3DFXmwmAYAMYQ08T2NnxoAAAAASUVORK5CYII="}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.circle.undo.json b/test/drawing/tests/pensize.circle.undo.json
new file mode 100644
index 00000000..006d7d24
--- /dev/null
+++ b/test/drawing/tests/pensize.circle.undo.json
@@ -0,0 +1 @@
+{"events":[{"type":"tool-event","toolId":"tool-circle"},{"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":"mousemove","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":1,"y":1},"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":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"event":{"type":"mousedown","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":"color-event","color":"#2d2dbd","isPrimary":true},{"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"type":"pensize-event","penSize":2},{"event":{"type":"mousedown","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":1,"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":3,"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":6},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":6},"type":"mouse-event"},{"type":"color-event","color":"#ff9100","isPrimary":true},{"type":"pensize-event","penSize":3},{"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":"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":8},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":8},"type":"mouse-event"},{"type":"color-event","color":"#31a626","isPrimary":true},{"type":"pensize-event","penSize":4},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":9},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":9},"type":"mouse-event"},{"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":"tool-event","toolId":"tool-pen"}],"initialState":{"size":{"width":12,"height":12},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAb0lEQVQoU2NkgID/DAwMjFA2XgqkCKYYTOvq7gXRDJcvO2M1ACb4//9ETIMZ8zFtBWv4PxFsC1aArokRn2KYCciaMDSAJNENwatBb85ehkspzijOw6sBm0dQNJDsaZiJ2DyPM1iJiWF4iJGiGKQWAIC4JQ2hxlSDAAAAAElFTkSuQmCC"}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.eraser.basic.json b/test/drawing/tests/pensize.eraser.basic.json
new file mode 100644
index 00000000..f3c02914
--- /dev/null
+++ b/test/drawing/tests/pensize.eraser.basic.json
@@ -0,0 +1 @@
+{"events":[{"type":"tool-event","toolId":"tool-paint-bucket"},{"event":{"type":"mousedown","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":3,"y":2},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":2},"type":"mouse-event"},{"type":"tool-event","toolId":"tool-eraser"},{"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":"pensize-event","penSize":2},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"type":"pensize-event","penSize":3},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":1},"type":"mouse-event"},{"type":"pensize-event","penSize":4},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":5},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":5},"type":"mouse-event"}],"initialState":{"size":{"width":8,"height":8},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAMUlEQVQYV2NkgID/DAwMjFjYYEGQJAgQVABVh6IYxQRkBXA2zFhkSZiVqEYhqaCyAgALQwoEbRLEzQAAAABJRU5ErkJggg=="}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.eraser.undo.json b/test/drawing/tests/pensize.eraser.undo.json
new file mode 100644
index 00000000..bb0edc1c
--- /dev/null
+++ b/test/drawing/tests/pensize.eraser.undo.json
@@ -0,0 +1 @@
+{"events":[{"type":"tool-event","toolId":"tool-paint-bucket"},{"type":"keyboard-event","event":{"which":66,"shiftKey":false,"altKey":false,"ctrlKey":false,"target":{"nodeName":"BODY"}}},{"event":{"type":"mousedown","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-eraser"},{"type":"pensize-event","penSize":1},{"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":"pensize-event","penSize":2},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":0},"type":"mouse-event"},{"type":"pensize-event","penSize":3},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":1},"type":"mouse-event"},{"type":"pensize-event","penSize":4},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":5},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":5},"type":"mouse-event"},{"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":"tool-event","toolId":"tool-pen"}],"initialState":{"size":{"width":8,"height":8},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen","penSize":4},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAKUlEQVQYV2NkgID/DAwMjFjYYEGQJAgQVABVh6IYxQRkBXA2shUDpQAASwMKBCPYrL8AAAAASUVORK5CYII="}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.pen.basic.json b/test/drawing/tests/pensize.pen.basic.json
new file mode 100644
index 00000000..a3879572
--- /dev/null
+++ b/test/drawing/tests/pensize.pen.basic.json
@@ -0,0 +1,140 @@
+{
+ "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": "pensize-event",
+ "penSize": 2
+ }, {
+ "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": "pensize-event",
+ "penSize": 3
+ }, {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": false,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 4,
+ "y": 1
+ },
+ "type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": false,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 4,
+ "y": 1
+ },
+ "type": "mouse-event"
+ }, {
+ "type": "pensize-event",
+ "penSize": 4
+ }, {
+ "event": {
+ "type": "mousedown",
+ "button": 0,
+ "shiftKey": false,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 5,
+ "y": 4
+ },
+ "type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mousemove",
+ "button": 0,
+ "shiftKey": false,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 5,
+ "y": 4
+ },
+ "type": "mouse-event"
+ }, {
+ "event": {
+ "type": "mouseup",
+ "button": 0,
+ "shiftKey": false,
+ "altKey": false,
+ "ctrlKey": false
+ },
+ "coords": {
+ "x": 5,
+ "y": 4
+ },
+ "type": "mouse-event"
+ }],
+ "initialState": {
+ "size": {
+ "width": 8,
+ "height": 8
+ },
+ "primaryColor": "#000000",
+ "secondaryColor": "rgba(0, 0, 0, 0)",
+ "selectedTool": "tool-pen",
+ "penSize": 1
+ },
+ "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALUlEQVQYV2NkYGD4z4AdMIKEwQQORSgKYGYgm4ZVAYZpMCuQXYHiJtooQPE0ABsyBwXCqrdKAAAAAElFTkSuQmCC"
+}
diff --git a/test/drawing/tests/pensize.pen.undo.json b/test/drawing/tests/pensize.pen.undo.json
new file mode 100644
index 00000000..082a6e9b
--- /dev/null
+++ b/test/drawing/tests/pensize.pen.undo.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":"pensize-event","penSize":2},{"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":"pensize-event","penSize":3},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"type":"pensize-event","penSize":4},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":5},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":5},"type":"mouse-event"},{"type":"keyboard-event","event":{"which":90,"shiftKey":false,"altKey":false,"ctrlKey":true,"target":{"nodeName":"BODY"}}}],"initialState":{"size":{"width":8,"height":8},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAK0lEQVQYV2NkYGD4z4AdMIKEwQQORSgKYGYgm4ZVAYZlMCtwOAPhBhoqAACekgMJrfUpnQAAAABJRU5ErkJggg=="}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.rectangle.basic.json b/test/drawing/tests/pensize.rectangle.basic.json
new file mode 100644
index 00000000..f5490b69
--- /dev/null
+++ b/test/drawing/tests/pensize.rectangle.basic.json
@@ -0,0 +1 @@
+{"events":[{"type":"color-event","color":"#ff0000","isPrimary":true},{"type":"tool-event","toolId":"tool-rectangle"},{"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":"mousemove","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":1,"y":1},"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":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":2},"type":"mouse-event"},{"type":"color-event","color":"#2d2dbd","isPrimary":true},{"type":"pensize-event","penSize":2},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":4},"type":"mouse-event"},{"type":"color-event","color":"#ff9100","isPrimary":true},{"type":"pensize-event","penSize":3},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":7},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":7},"type":"mouse-event"},{"type":"color-event","color":"#31a626","isPrimary":true},{"type":"pensize-event","penSize":4},{"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":"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":3,"y":2},"type":"mouse-event"},{"event":{"type":"mousemove","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":4,"y":3},"type":"mouse-event"},{"event":{"type":"mousemove","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":5,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":9},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":9},"type":"mouse-event"}],"initialState":{"size":{"width":12,"height":12},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAOElEQVQoU2M0XKb2n4EEwDgENJx7fQvsI705e8E0S2Umig8x/EC2BpixRqJqxNlAtAZCUTII4wEAtH4n3fmJ9+kAAAAASUVORK5CYII="}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.rectangle.undo.json b/test/drawing/tests/pensize.rectangle.undo.json
new file mode 100644
index 00000000..17478e9f
--- /dev/null
+++ b/test/drawing/tests/pensize.rectangle.undo.json
@@ -0,0 +1 @@
+{"events":[{"type":"tool-event","toolId":"tool-rectangle"},{"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":"mousemove","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":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":"color-event","color":"#2d2dbd","isPrimary":true},{"type":"pensize-event","penSize":2},{"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":"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":3},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":3},"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"},{"type":"color-event","color":"#ff9100","isPrimary":true},{"type":"pensize-event","penSize":3},{"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":8},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":8},"type":"mouse-event"},{"type":"color-event","color":"#31a626","isPrimary":true},{"type":"pensize-event","penSize":4},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":7},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":9},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":9},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":10},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":10},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":11,"y":10},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":11,"y":11},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":12,"y":11},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":12,"y":12},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":13,"y":12},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":14,"y":12},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":13,"y":12},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":13,"y":11},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":12,"y":11},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":11,"y":11},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":11,"y":10},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":10},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":9},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":9},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":8,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":8},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":9,"y":9},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":9},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":10},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":10,"y":10},"type":"mouse-event"},{"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":"tool-event","toolId":"tool-pen"}],"initialState":{"size":{"width":12,"height":12},"primaryColor":"#ff0000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAXElEQVQoU2P8z8DwnwEKGBkYGGFsXDQjSIOe7l4M+cuXnbFqJl0DyGhd3b1gZ11KccbpIsZ8iHPBBO01wNzxfyJSiOUzMKLz4U7CpgHdMyh+oJ8GQrGM4QdiNAAAlfwnDeKFMp0AAAAASUVORK5CYII="}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.stroke.basic.json b/test/drawing/tests/pensize.stroke.basic.json
new file mode 100644
index 00000000..4ffa20f4
--- /dev/null
+++ b/test/drawing/tests/pensize.stroke.basic.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":"mousemove","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":1,"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":3,"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":0},"type":"mouse-event"},{"type":"pensize-event","penSize":2},{"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":"mousemove","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":2,"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":1},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":1},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":1},"type":"mouse-event"},{"type":"pensize-event","penSize":3},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":2,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":4,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":5},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":5},"type":"mouse-event"},{"type":"color-event","color":"#ff0000","isPrimary":true},{"type":"pensize-event","penSize":4},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":3,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","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":2},"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"}],"initialState":{"size":{"width":8,"height":8},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-stroke","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAK0lEQVQYV2NkYGD4zwAjQAwoYESiKVcANuw/1CokK8C2gAjKrSBoAl43AADRvhADjb+9VAAAAABJRU5ErkJggg=="}
\ No newline at end of file
diff --git a/test/drawing/tests/pensize.stroke.undo.json b/test/drawing/tests/pensize.stroke.undo.json
new file mode 100644
index 00000000..037eb46e
--- /dev/null
+++ b/test/drawing/tests/pensize.stroke.undo.json
@@ -0,0 +1 @@
+{"events":[{"type":"tool-event","toolId":"tool-stroke"},{"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"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":3,"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":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":5,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":0},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":7,"y":0},"type":"mouse-event"},{"type":"pensize-event","penSize":2},{"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":"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":0,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":3},"type":"mouse-event"},{"type":"pensize-event","penSize":3},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":4},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":6,"y":3},"type":"mouse-event"},{"type":"color-event","color":"#b8ff00","isPrimary":true},{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":6},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":5},"type":"mouse-event"},{"event":{"type":"mousemove","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":1,"y":4},"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"},{"type":"keyboard-event","event":{"which":90,"shiftKey":false,"altKey":false,"ctrlKey":true,"target":{"nodeName":"BODY"}}}],"initialState":{"size":{"width":8,"height":8},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen","penSize":1},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NkYGD4z4AHMCIpALExAC4FcFOpowCb1ShWUKYAAPGuCwKQGbMQAAAAAElFTkSuQmCC"}
\ No newline at end of file
diff --git a/test/js/service/pensize/PenSizeServiceTest.js b/test/js/service/pensize/PenSizeServiceTest.js
new file mode 100644
index 00000000..3fd48c13
--- /dev/null
+++ b/test/js/service/pensize/PenSizeServiceTest.js
@@ -0,0 +1,73 @@
+describe("PenSize test suite", function() {
+ var penSizeService;
+ var userSettingsBackup;
+ var userSettingsPenSize;
+
+ beforeEach(function() {
+ userSettingsBackup = pskl.UserSettings;
+
+ pskl.UserSettings = {
+ PEN_SIZE : 'PEN_SIZE_TEST_KEY',
+ get : function () {
+ return userSettingsPenSize;
+ },
+
+ set : function (size) {
+ userSettingsPenSize = size;
+ }
+ };
+
+ spyOn(pskl.UserSettings, 'get').and.callThrough();
+ spyOn(pskl.UserSettings, 'set').and.callThrough();
+ spyOn($, 'publish').and.callThrough();
+
+
+ penSizeService = new pskl.service.pensize.PenSizeService();
+ });
+
+ afterEach(function () {
+ pskl.UserSettings = userSettingsBackup;
+ });
+
+ it("gets initial value from user settings", function() {
+ console.log('[PenSizeService] gets initial value from user settings');
+ userSettingsPenSize = 2;
+
+ penSizeService.init();
+ expect(penSizeService.getPenSize()).toBe(2);
+ expect(pskl.UserSettings.get).toHaveBeenCalledWith('PEN_SIZE_TEST_KEY');
+ });
+
+ it("saves valid value to user settings", function() {
+ console.log('[PenSizeService] saves valid value to user settings');
+ userSettingsPenSize = 1;
+
+ penSizeService.init();
+ penSizeService.setPenSize(3);
+ expect(penSizeService.getPenSize()).toBe(3);
+
+ expect(pskl.UserSettings.set).toHaveBeenCalledWith('PEN_SIZE_TEST_KEY', 3);
+ expect($.publish).toHaveBeenCalledWith(Events.PEN_SIZE_CHANGED);
+ });
+
+ it("skips invalid value (outside of [1, 4])", function() {
+ console.log('[PenSizeService] skips invalid value (outside of [1, 4])');
+ userSettingsPenSize = 1;
+
+ penSizeService.init();
+ // MAX_VALUE is 4
+ penSizeService.setPenSize(5);
+ expect(penSizeService.getPenSize()).toBe(1);
+ // MIN_VALUE is 1
+ penSizeService.setPenSize(0);
+ expect(penSizeService.getPenSize()).toBe(1);
+ // value should be a number
+ penSizeService.setPenSize("test");
+ expect(penSizeService.getPenSize()).toBe(1);
+
+ // nothing set in usersettings
+ expect(pskl.UserSettings.set.calls.any()).toBe(false);
+ // no event fired
+ expect($.publish.calls.any()).toBe(false);
+ });
+});
\ No newline at end of file