Issue #258 : Add pensize support to DrawingTest + add pensize test suite

This commit is contained in:
jdescottes
2015-11-28 00:24:52 +01:00
parent f0ed4927e8
commit 92d5a4a2fe
13 changed files with 182 additions and 1 deletions

View File

@@ -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.PEN_SIZE_CHANGED, this.onPenSizeChanged_.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));
@@ -48,7 +49,8 @@
},
primaryColor : pskl.app.selectedColorsService.getPrimaryColor(),
secondaryColor : pskl.app.selectedColorsService.getSecondaryColor(),
selectedTool : pskl.app.toolController.currentSelectedTool.toolId
selectedTool : pskl.app.toolController.currentSelectedTool.toolId,
penSize : pskl.app.penSizeService.getPenSize()
};
};
@@ -111,6 +113,15 @@
}
};
ns.DrawingTestRecorder.prototype.onPenSizeChanged_ = function (evt) {
if (this.isRecording) {
var recordEvent = {};
recordEvent.type = 'pensize-event';
recordEvent.penSize = pskl.app.penSizeService.getPenSize();
this.events.push(recordEvent);
}
};
ns.DrawingTestRecorder.prototype.onTransformationEvent_ = function (evt, toolId, domEvent) {
if (this.isRecording) {
var recordEvent = {};