Andreas Höschler wrote:
> can anybody confirm that selecting the empty row between e.g.
> 
> #import "hello.h"
> 
> #import "beyer.h"
> 
> in a NSTextView with a tripleclick does not work under GNUstep? On my
> machine either the top or the bottom non-zero-length line is selected,
> but not the line in the middle. This behaviour is wrong! Any idea?
> 

I would expect this behaviour to be caused by the implementation of
[NSTextView selectLine:], which uses [NSLayoutManager
characterIndexMoving:fromCharacterIndex:originalCharacterIndex:] to do
the actual work.
But the solution may even be simpler. When you click on the empty line
the cursor is not set to this line but to the next. I would expect that
as soon as this is corrected the rest will work. So have a look at
[NSText mouseDown:] and characterIndexForPoint: first. It may well be
that for empty lines we always have a fraction of > 0.5 and because of
that end up in the next line. Thinking about it this sounds rather
plausible. So [NSLayoutManager
glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:] may
be the key to your problem.

Cheers,
Fred


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to