From 24222f956551faf64c2eddd6eb02c4f89508a3ab Mon Sep 17 00:00:00 2001 From: "A.Olokhtonov" Date: Tue, 5 Dec 2023 01:21:28 +0300 Subject: [PATCH] Fix wrong sort order for indices --- client/bvh.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/bvh.js b/client/bvh.js index b1d43e4..c913a6f 100644 --- a/client/bvh.js +++ b/client/bvh.js @@ -219,7 +219,7 @@ function bvh_clip(state, context) { const screen = {'x1': screen_topleft.x, 'y1': screen_topleft.y, 'x2': screen_bottomright.x, 'y2': screen_bottomright.y}; const stroke_indices = bvh_intersect_quad(state.bvh, screen); - stroke_indices.sort(); + stroke_indices.sort((a, b) => a - b); for (const i of stroke_indices) { if (state.debug.limit_to && i >= state.debug.render_to) break;