Commit 5e21e0bd authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

js/segmenter.js: fix highlight fields, both start and stop positions are included

Checked on Demo-X5 both on 2016.03 and 2016.07 outputs (that are both 1-based),
and both on 'cdr3' (computed with -3) and 'id' fields.
parent d22bb9ca
......@@ -1244,9 +1244,10 @@ Sequence.prototype = {
var raw_seq = ""
// Build the highlight object from p
// Both 'start' and 'stop' positions are included in the highlight
if (p.constructor === String){
h.start = this.pos[clone.sequence.indexOf(p)]
h.stop = this.pos[clone.sequence.indexOf(p)+p.length]
h.stop = this.pos[clone.sequence.indexOf(p)+p.length-1]
}else if (p.constructor === Object & typeof p.start != 'undefined'){
h.start = this.pos[p.start];
h.stop = this.pos[p.stop];
......@@ -1260,7 +1261,7 @@ Sequence.prototype = {
// Build the (possibly invisible) sequence
if (raw_seq == "") {
h.css = "highlight_border"
for (var k=0; k<(h.stop - h.start); k++) h.seq += "\u00A0"
for (var k=0; k<(h.stop - h.start + 1); k++) h.seq += "\u00A0"
} else {
h.css = "highlight_seq"
var j = 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment