Skip to content

Commit 8145643

Browse files
authored
Merge pull request #19661 from Mugen87/dev45
MeshSurfaceSampler: Fix mid value in .binarySearch().
2 parents fbb7875 + 9717434 commit 8145643

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/jsm/math/MeshSurfaceSampler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ var MeshSurfaceSampler = ( function () {
128128

129129
while ( start <= end ) {
130130

131-
var mid = Math.floor( ( start + end ) / 2 );
131+
var mid = Math.ceil( ( start + end ) / 2 );
132132

133133
if ( mid === 0 || dist[ mid - 1 ] <= x && dist[ mid ] > x ) {
134134

0 commit comments

Comments
 (0)