Correct computation of attachment cell frame.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27750 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-02-01 14:07:30 +00:00
parent 774a9ec1d4
commit a815330b26
3 changed files with 23 additions and 10 deletions

View file

@ -1,3 +1,10 @@
2009-02-01 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTextView.m (-dragSelectionWithEvent:...): Correct
computation of attachment cell frame.
* Source/NSParagraphStyle.m (NSMutableParagraphStyle
-setParagraphStyle:): Set only existing text blocks and text lists.
2009-01-31 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSDisplayServer.m: Fix typo

View file

@ -220,15 +220,14 @@ static NSParagraphStyle *defaultStyle = nil;
int i;
for (i = 0; i < 12; i++)
{
NSTextTab *tab;
{
NSTextTab *tab;
/* FIXME: (i * 1) ? */
tab = [[NSTextTab alloc] initWithType: NSLeftTabStopType
location: (i * 1) * 28.0];
[style->_tabStops addObject: tab];
RELEASE(tab);
}
tab = [[NSTextTab alloc] initWithType: NSLeftTabStopType
location: (i + 1) * 28.0];
[style->_tabStops addObject: tab];
RELEASE(tab);
}
defaultStyle = style;
}
return defaultStyle;
@ -782,8 +781,10 @@ static NSParagraphStyle *defaultStyle = nil;
[_tabStops removeAllObjects];
[_tabStops addObjectsFromArray: p->_tabStops];
[self setTextBlocks: [p textBlocks]];
[self setTextLists: [p textLists]];
if (p->_textBlocks)
[self setTextBlocks: p->_textBlocks];
if (p->_textLists)
[self setTextLists: p->_textLists];
_alignment = p->_alignment;
_firstLineHeadIndent = p->_firstLineHeadIndent;

View file

@ -4811,12 +4811,17 @@ other than copy/paste or dragging. */
if (cell != nil)
{
NSRect cellFrame;
NSRect lfRect;
lfRect = [_layoutManager lineFragmentRectForGlyphAtIndex: startIndex
effectiveRange: NULL];
cellFrame.origin = [_layoutManager
locationForGlyphAtIndex: startIndex];
cellFrame.size = [_layoutManager
attachmentSizeForGlyphAtIndex: startIndex];
cellFrame.origin.y -= cellFrame.size.height;
cellFrame.origin.x += lfRect.origin.x;
cellFrame.origin.y += lfRect.origin.y;
/* TODO: What about the insertion point ? */
if ([cell wantsToTrackMouseForEvent: theEvent