From 86193fe26d908f1c800b73a2c5370d3f14246f90 Mon Sep 17 00:00:00 2001 From: "A.Olokhtonov" Date: Sun, 8 Dec 2024 16:25:39 +0300 Subject: [PATCH] Reset player.current_prestroke if we deleted last prestroke of theirs --- client/webgl_geometry.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/webgl_geometry.js b/client/webgl_geometry.js index 85df64e..d7bdc89 100644 --- a/client/webgl_geometry.js +++ b/client/webgl_geometry.js @@ -250,6 +250,10 @@ function geometry_clear_oldest_prestroke(state, context, player_id) { const player = state.players[player_id]; player.strokes.shift(); + if (player.strokes.length === 0) { + player.current_prestroke = false; + } + recompute_dynamic_data(state, context); } @@ -259,6 +263,10 @@ function geometry_clear_newest_prestroke(state, context, player_id) { const player = state.players[player_id]; player.strokes.pop(); + if (player.strokes.length === 0) { + player.current_prestroke = false; + } + recompute_dynamic_data(state, context); }