diff --git a/README.md b/README.md index 26378f7..b04858e 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Release: - Textured quads (pictures, code already written in older version) - Resize and move pictures (draw handles) - Further investigate GC pauses in Firefox - * Bugs + + Bugs + GC stalls!!! - - Stroke previews get connected when drawn without panning on touch devices + + Stroke previews get connected when drawn without panning on touch devices - Debug - Restore ability to limit event range * Listeners/events/multiplayer diff --git a/client/client_recv.js b/client/client_recv.js index 4fecb09..e1fa77d 100644 --- a/client/client_recv.js +++ b/client/client_recv.js @@ -391,10 +391,11 @@ async function handle_message(state, context, d) { } else { color = des_u32(d); width = des_u16(d); - state.me = parseInt(localStorage.getItem('sessionId')); if (config.debug_print) console.debug('init in'); } + state.me = parseInt(localStorage.getItem('sessionId')); + init_player_defaults(state, state.me); set_color_u32(state, color); diff --git a/client/index.html b/client/index.html index a6f646f..851670c 100644 --- a/client/index.html +++ b/client/index.html @@ -7,22 +7,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
diff --git a/client/webgl_geometry.js b/client/webgl_geometry.js index 1b7a305..2792d73 100644 --- a/client/webgl_geometry.js +++ b/client/webgl_geometry.js @@ -311,7 +311,6 @@ function geometry_clear_player(state, context, player_id) { if (!state.online) return; state.players[player_id].points.length = 0; recompute_dynamic_data(state, context); - schedule_draw(state, context); } function add_image(context, image_id, bitmap, p) { diff --git a/client/webgl_listeners.js b/client/webgl_listeners.js index 983f1ba..1086f05 100644 --- a/client/webgl_listeners.js +++ b/client/webgl_listeners.js @@ -3,10 +3,10 @@ function init_listeners(state, context) { window.addEventListener('keyup', (e) => keyup(e, state, context)); window.addEventListener('paste', (e) => paste(e, state, context)); - context.canvas.addEventListener('mousedown', (e) => mousedown(e, state, context)); - context.canvas.addEventListener('mousemove', (e) => mousemove(e, state, context)); - context.canvas.addEventListener('mouseup', (e) => mouseup(e, state, context)); - context.canvas.addEventListener('mouseleave', (e) => mouseup(e, state, context)); + context.canvas.addEventListener('pointerdown', (e) => mousedown(e, state, context)); + context.canvas.addEventListener('pointermove', (e) => mousemove(e, state, context)); + context.canvas.addEventListener('pointerup', (e) => mouseup(e, state, context)); + context.canvas.addEventListener('pointerleave', (e) => mouseup(e, state, context)); context.canvas.addEventListener('contextmenu', cancel); context.canvas.addEventListener('wheel', (e) => wheel(e, state, context)); @@ -246,6 +246,7 @@ function mousemove(e, state, context) { } if (state.drawing) { + //console.log(e.pressure); geometry_add_point(state, context, state.me, canvasp); fire_event(state, predraw_event(canvasp.x, canvasp.y)); do_draw = true; @@ -518,6 +519,7 @@ function touchend(e, state, context) { if (stroke) { queue_event(state, stroke_event(state)); + //geometry_clear_player(state, context, state.me); schedule_draw(state, context); }