Skip to content

Commit

Permalink
dont early return the highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bradbury committed Jul 18, 2022
1 parent 7cebafd commit 20d5906
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/display-jsui.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,20 +367,21 @@ class MarkerLayer {

search(desc, x)
{
let extent = desc.length
let factor = extent / this.canvas.width
let offset = desc.extent[0]
let extent = desc.length;
let factor = extent / this.canvas.width;
let offset = desc.extent[0];
let pos = ((x + this.margin/2) * factor) | 0;
let anyselected = false;
for(let i = 0; i < desc.data.length; i++)
{
let y = desc.data[i].position - offset
desc.data[i].selected = pos > y - (10 * factor) && pos < y + (10 * factor)
if(desc.data[i].selected)
{
return desc.data[i]
anyselected = true;
}
}
return null
return anyselected;
}
}

Expand Down

0 comments on commit 20d5906

Please sign in to comment.