From 01560389af33dfa23dd56cbff29d645dbc16c567 Mon Sep 17 00:00:00 2001 From: Aleksey Olokhtonov Date: Sun, 12 May 2024 13:08:32 +0300 Subject: [PATCH] Fix predrawn curves having zero width --- client/client_recv.js | 2 +- client/webgl_draw.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/client_recv.js b/client/client_recv.js index 262c165..76e8d70 100644 --- a/client/client_recv.js +++ b/client/client_recv.js @@ -184,7 +184,7 @@ function handle_event(state, context, event, options = {}) { } case EVENT.PREDRAW: { - geometry_add_point(state, context, event.user_id, {'x': event.x, 'y': event.y}, 0.5); // TODO: event.pressure + geometry_add_point(state, context, event.user_id, {'x': event.x, 'y': event.y, 'pressure': 128}, false); // TODO: add pressure to predraw events need_draw = true; break; } diff --git a/client/webgl_draw.js b/client/webgl_draw.js index 5862f82..7cee1d3 100644 --- a/client/webgl_draw.js +++ b/client/webgl_draw.js @@ -251,6 +251,7 @@ async function draw(state, context, animate, ts) { gl.vertexAttribDivisor(locations['a_stroke_id'], 0); gl.vertexAttribDivisor(locations['a_pressure'], 0); } + // Dynamic strokes should be drawn above static strokes gl.clear(gl.DEPTH_BUFFER_BIT);