mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:50:48 +00:00
Add missing conversion from character indexes to glyph indexes when
computing an attachment cell's frame in a text view. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31815 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c5cc86b23b
commit
f29e316d4e
2 changed files with 24 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSTextView.m (-mouseDown:): Add missing conversion from
|
||||||
|
character indexes to glyph indexes when computing an attachment
|
||||||
|
cell's frame.
|
||||||
|
|
||||||
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSLayoutManager.m (attachmentSize): Prevent potential
|
* Source/NSLayoutManager.m (attachmentSize): Prevent potential
|
||||||
|
|
|
@ -5239,17 +5239,26 @@ other than copy/paste or dragging. */
|
||||||
if (cell != nil)
|
if (cell != nil)
|
||||||
{
|
{
|
||||||
NSRect cellFrame;
|
NSRect cellFrame;
|
||||||
NSRect lfRect;
|
NSRect lfRect;
|
||||||
|
NSUInteger glyphIndex;
|
||||||
|
|
||||||
lfRect = [_layoutManager lineFragmentRectForGlyphAtIndex: startIndex
|
glyphIndex =
|
||||||
effectiveRange: NULL];
|
[_layoutManager
|
||||||
cellFrame.origin = [_layoutManager
|
glyphRangeForCharacterRange: NSMakeRange(startIndex, 1)
|
||||||
locationForGlyphAtIndex: startIndex];
|
actualCharacterRange: NULL].location;
|
||||||
cellFrame.size = [_layoutManager
|
lfRect =
|
||||||
attachmentSizeForGlyphAtIndex: startIndex];
|
[_layoutManager
|
||||||
|
lineFragmentRectForGlyphAtIndex: glyphIndex
|
||||||
|
effectiveRange: NULL];
|
||||||
|
cellFrame.origin =
|
||||||
|
[_layoutManager
|
||||||
|
locationForGlyphAtIndex: glyphIndex];
|
||||||
|
cellFrame.size =
|
||||||
|
[_layoutManager
|
||||||
|
attachmentSizeForGlyphAtIndex: glyphIndex];
|
||||||
cellFrame.origin.y -= cellFrame.size.height;
|
cellFrame.origin.y -= cellFrame.size.height;
|
||||||
cellFrame.origin.x += lfRect.origin.x;
|
cellFrame.origin.x += lfRect.origin.x;
|
||||||
cellFrame.origin.y += lfRect.origin.y;
|
cellFrame.origin.y += lfRect.origin.y;
|
||||||
|
|
||||||
/* TODO: What about the insertion point ? */
|
/* TODO: What about the insertion point ? */
|
||||||
if ([cell wantsToTrackMouseForEvent: theEvent
|
if ([cell wantsToTrackMouseForEvent: theEvent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue