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;