Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js |
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | }; |
149 | 149 | while ( position.line < lineCount ) { |
150 | 150 | line = this.lines[position.line]; |
151 | | - if ( offset >= line.range.start && offset < line.range.end ) { |
| 151 | + if ( line.range.containsOffset( offset ) ) { |
152 | 152 | position.bottom = position.top + line.height; |
153 | 153 | break; |
154 | 154 | } |
Index: trunk/parsers/wikidom/lib/es/es.Range.js |
— | — | @@ -15,6 +15,11 @@ |
16 | 16 | this.normalize(); |
17 | 17 | }; |
18 | 18 | |
| 19 | +es.Range.prototype.containsOffset = function( offset ) { |
| 20 | + this.normalize(); |
| 21 | + return offset >= this.start && offset < this.end; |
| 22 | +}; |
| 23 | + |
19 | 24 | es.Range.prototype.getLength = function() { |
20 | 25 | return Math.abs( this.from - this.to ); |
21 | 26 | }; |