feat(frontend): default to mouse and don't emit cursor while drawing

This commit is contained in:
Florent Chehab 2020-05-02 13:05:04 +02:00
parent 8a1f1b4210
commit b0501824cf
No known key found for this signature in database
GPG Key ID: 9A0CE018889EA246
2 changed files with 7 additions and 1 deletions

View File

@ -77,6 +77,9 @@ function main() {
whiteboardId: whiteboardId, whiteboardId: whiteboardId,
username: btoa(myUsername), username: btoa(myUsername),
sendFunction: function (content) { sendFunction: function (content) {
if (content.t === 'cursor') {
if (whiteboard.drawFlag) return;
}
content["at"] = accessToken; content["at"] = accessToken;
signaling_socket.emit('drawToWhiteboard', content); signaling_socket.emit('drawToWhiteboard', content);
$('#messageSentCount')[0].innerText = String(messageSentCount++); $('#messageSentCount')[0].innerText = String(messageSentCount++);
@ -631,6 +634,9 @@ function main() {
whiteboard.setDrawColor(color.rgbaString); whiteboard.setDrawColor(color.rgbaString);
} }
}); });
// on startup select mouse
shortcutFunctions.setTool_mouse();
}); });
//Prevent site from changing tab on drag&drop //Prevent site from changing tab on drag&drop

View File

@ -4,7 +4,7 @@ const whiteboard = {
canvas: null, canvas: null,
ctx: null, ctx: null,
drawcolor: "black", drawcolor: "black",
tool: "pen", tool: "mouse",
thickness: 4, thickness: 4,
prevX: null, //prev Mouse position prevX: null, //prev Mouse position
prevY: null, prevY: null,