mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 20:17:38 +00:00
More selection fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8451 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7fdaabcdde
commit
afc3dfd686
3 changed files with 36 additions and 10 deletions
|
@ -3114,12 +3114,19 @@ other than copy/paste or dragging. */
|
|||
|
||||
- (unsigned) characterIndexForPoint: (NSPoint) point
|
||||
{
|
||||
unsigned glyphIndex;
|
||||
unsigned index;
|
||||
float fraction;
|
||||
|
||||
glyphIndex = [_layoutManager glyphIndexForPoint: point
|
||||
inTextContainer: _textContainer];
|
||||
index = [_layoutManager glyphIndexForPoint: point
|
||||
inTextContainer: _textContainer
|
||||
fractionOfDistanceThroughGlyph: &fraction];
|
||||
|
||||
return [_layoutManager characterIndexForGlyphAtIndex: glyphIndex];
|
||||
index = [_layoutManager characterIndexForGlyphAtIndex: index];
|
||||
if (fraction > 0.5)
|
||||
{
|
||||
index++;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
- (NSRect) rectForCharacterIndex: (unsigned)index
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue