Index: trunk/parsers/wikidom/lib/hype/views/es.ContentView.js |
— | — | @@ -332,12 +332,14 @@ |
333 | 333 | ruler = $ruler[0], |
334 | 334 | fit = this.fitCharacters( line.range, ruler, position.left ); |
335 | 335 | ruler.innerHTML = this.getHtml( new es.Range( line.range.start, fit.end ) ); |
336 | | - var left = ruler.clientWidth; |
337 | 336 | if ( fit.end < this.model.getContentLength() ) { |
| 337 | + var left = ruler.clientWidth; |
338 | 338 | ruler.innerHTML = this.getHtml( new es.Range( line.range.start, fit.end + 1 ) ); |
| 339 | + var right = ruler.clientWidth; |
| 340 | + var center = Math.round( left + ( ( right - left ) / 2 ) ); |
| 341 | + } else { |
| 342 | + var center = ruler.clientWidth; |
339 | 343 | } |
340 | | - var right = ruler.clientWidth; |
341 | | - var center = Math.round( left + ( ( right - left ) / 2 ) ); |
342 | 344 | $ruler.remove(); |
343 | 345 | // Reset RegExp object's state |
344 | 346 | this.boundaryTest.lastIndex = 0; |