}
private Coordinate translate( final Coordinate coordinate, final Coordinate start )
{
if( coordinate.y_ < start.y_ )
return new Coordinate( 0, 0 );
if( coordinate.y_ > start.y_ + lines_ )
return new Coordinate( lastLineLength_, lines_ );
final int y = coordinate.y_ - start.y_;
if( coordinate.x_ <= start.x_ )
return new Coordinate( 0, y );
final int x = getText().getLine( y ).length();
if( coordinate.x_ >= start.x_ + x )
return new Coordinate( x, y );
return new Coordinate( coordinate.x_ - start.x_, y );
}