Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -592,10 +592,29 @@ |
593 | 593 | } else if (fakePosition.top > top + this.dimensions.height + this.dimensions.scrollTop ) { |
594 | 594 | break; |
595 | 595 | } |
596 | | - fakePosition = this.documentView.getRenderedPositionFromOffset( |
597 | | - this.documentView.getOffsetFromRenderedPosition( fakePosition ), |
598 | | - this.cursor.initialBias |
| 596 | + offset = this.documentView.getOffsetFromRenderedPosition( fakePosition ); |
| 597 | + fakePosition1 = this.documentView.getRenderedPositionFromOffset( |
| 598 | + offset, |
| 599 | + false |
599 | 600 | ); |
| 601 | + fakePosition2 = this.documentView.getRenderedPositionFromOffset( |
| 602 | + offset, |
| 603 | + true |
| 604 | + ); |
| 605 | + |
| 606 | + if(this.cursor.initialBias) { |
| 607 | + if(fakePosition1.top != fakePosition2.top) { |
| 608 | + fakePosition = fakePosition2; |
| 609 | + newBias = true; |
| 610 | + } else { |
| 611 | + fakePosition = fakePosition1; |
| 612 | + //newBias = true; |
| 613 | + } |
| 614 | + } else { |
| 615 | + fakePosition = fakePosition1; |
| 616 | + newBias = false; |
| 617 | + } |
| 618 | + |
600 | 619 | fakePosition.left = this.cursor.initialLeft; |
601 | 620 | } while ( position.top === fakePosition.top ); |
602 | 621 | to = this.documentView.getOffsetFromRenderedPosition( fakePosition ); |
— | — | @@ -604,12 +623,13 @@ |
605 | 624 | break; |
606 | 625 | } |
607 | 626 | |
608 | | - this.cursor.initialBias = ( |
609 | | - ( direction === 'right' && unit === 'line' ) || |
610 | | - ( this.cursor.initialBias && direction === 'down' && unit === 'char' ) || |
611 | | - ( this.cursor.initialBias && direction === 'up' && unit === 'char' ) ) ? |
612 | | - true : |
613 | | - false; |
| 627 | + if(typeof newBias !== 'undefined') { |
| 628 | + this.cursor.initialBias = newBias; |
| 629 | + } |
| 630 | + |
| 631 | + if( direction != 'up' && direction != 'down' ) { |
| 632 | + this.cursor.initialBias = direction === 'right' && unit === 'line' ? true : false; |
| 633 | + } |
614 | 634 | |
615 | 635 | if ( this.keyboard.keys.shift && this.selection.from !== to) { |
616 | 636 | this.selection.to = to; |